From be1ba7229c9e1d11943ce7d4c1fdf4d320ec478e Mon Sep 17 00:00:00 2001 From: P0nk Date: Fri, 27 Jun 2025 09:21:17 +0200 Subject: [PATCH] Add pet changeset --- src/main/resources/db/005-pet.sql | 20 ++++++++++++++++++++ src/main/resources/db/changelog.xml | 4 ++++ 2 files changed, 24 insertions(+) create mode 100644 src/main/resources/db/005-pet.sql diff --git a/src/main/resources/db/005-pet.sql b/src/main/resources/db/005-pet.sql new file mode 100644 index 0000000000..e2b442ce90 --- /dev/null +++ b/src/main/resources/db/005-pet.sql @@ -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 +); \ No newline at end of file diff --git a/src/main/resources/db/changelog.xml b/src/main/resources/db/changelog.xml index d5532b3c72..6655642144 100644 --- a/src/main/resources/db/changelog.xml +++ b/src/main/resources/db/changelog.xml @@ -21,4 +21,8 @@ + + + + \ No newline at end of file