feat: enhance habitat appearances and item relations

Replace item tags with favorite things to unify entity tagging
Allow multiple maps, times, and weathers per habitat appearance
Make item usage optional and translate API error messages to Chinese
Add .dockerignore files for backend and frontend
This commit is contained in:
2026-04-30 06:34:23 +08:00
parent f6a40097c1
commit 7f36d6a916
11 changed files with 186 additions and 115 deletions

View File

@@ -48,11 +48,6 @@ CREATE TABLE IF NOT EXISTS acquisition_methods (
name text NOT NULL UNIQUE
);
CREATE TABLE IF NOT EXISTS item_tags (
id integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name text NOT NULL UNIQUE
);
CREATE TABLE IF NOT EXISTS recipes (
id integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name text NOT NULL UNIQUE
@@ -68,23 +63,28 @@ CREATE TABLE IF NOT EXISTS items (
id integer GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
name text NOT NULL UNIQUE,
category_id integer NOT NULL REFERENCES item_categories(id),
usage_id integer NOT NULL REFERENCES item_usages(id),
usage_id integer REFERENCES item_usages(id),
recipe_id integer REFERENCES recipes(id),
dyeable boolean NOT NULL DEFAULT false,
dual_dyeable boolean NOT NULL DEFAULT false,
pattern_editable boolean NOT NULL DEFAULT false
);
ALTER TABLE items ALTER COLUMN usage_id DROP NOT NULL;
DROP TABLE IF EXISTS item_item_tags;
DROP TABLE IF EXISTS item_tags;
CREATE TABLE IF NOT EXISTS item_acquisition_methods (
item_id integer NOT NULL REFERENCES items(id) ON DELETE CASCADE,
acquisition_method_id integer NOT NULL REFERENCES acquisition_methods(id),
PRIMARY KEY (item_id, acquisition_method_id)
);
CREATE TABLE IF NOT EXISTS item_item_tags (
CREATE TABLE IF NOT EXISTS item_favorite_things (
item_id integer NOT NULL REFERENCES items(id) ON DELETE CASCADE,
item_tag_id integer NOT NULL REFERENCES item_tags(id),
PRIMARY KEY (item_id, item_tag_id)
favorite_thing_id integer NOT NULL REFERENCES favorite_things(id),
PRIMARY KEY (item_id, favorite_thing_id)
);
CREATE TABLE IF NOT EXISTS recipe_materials (