Add pet changeset

This commit is contained in:
P0nk
2025-06-27 09:21:17 +02:00
parent 37e6b16656
commit be1ba7229c
2 changed files with 24 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
CREATE TABLE lb_pets
(
petid INT UNSIGNED NOT NULL AUTO_INCREMENT,
name VARCHAR(13) DEFAULT NULL,
level INT UNSIGNED NOT NULL,
closeness INT UNSIGNED NOT NULL,
fullness INT UNSIGNED NOT NULL,
summoned TINYINT NOT NULL DEFAULT '0',
flag INT UNSIGNED NOT NULL DEFAULT '0',
PRIMARY KEY (petid)
);
CREATE TABLE lb_petignores
(
id INT UNSIGNED NOT NULL AUTO_INCREMENT,
petid INT UNSIGNED NOT NULL,
itemid INT UNSIGNED NOT NULL,
PRIMARY KEY (id),
CONSTRAINT lb_fk_petignorepetid FOREIGN KEY (petid) REFERENCES lb_pets (petid) ON DELETE CASCADE # thanks Optimist for noticing queries over petid taking too long, shavit for pointing out an improvement using foreign key
);

View File

@@ -21,4 +21,8 @@
<sqlFile path="db/004-skill.sql"/>
</changeSet>
<changeSet id="5" author="Ponk">
<sqlFile path="db/005-pet.sql"/>
</changeSet>
</databaseChangeLog>