summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2021-11-06 12:31:20 +0100
committerYorhel <git@yorhel.nl>2022-03-29 16:13:43 +0200
commit9ce994eba64c640cc7142171dd86fd6b293ed6bb (patch)
treea4ebf521526c6c27b14dc80f287aee6981624d04 /util
parentab2daacf35905c01541abc92988a666ab8d9a7e2 (diff)
Add new release animation fields
As discussed in t17596 The code and storage method for this is really quite ugly, but I tried to not bloat the code too much.
Diffstat (limited to 'util')
-rw-r--r--util/updates/2022-03-29-release-animation.sql29
1 files changed, 29 insertions, 0 deletions
diff --git a/util/updates/2022-03-29-release-animation.sql b/util/updates/2022-03-29-release-animation.sql
new file mode 100644
index 00000000..cc6a5a20
--- /dev/null
+++ b/util/updates/2022-03-29-release-animation.sql
@@ -0,0 +1,29 @@
+BEGIN;
+
+CREATE DOMAIN animation AS smallint CHECK(value IS NULL OR value IN(0,1) OR ((value & (4+8+16+32)) > 0 AND (value & (256+512)) <> (256+512)));
+
+ALTER TABLE releases ADD COLUMN ani_story_sp animation;
+ALTER TABLE releases ADD COLUMN ani_story_cg animation;
+ALTER TABLE releases ADD COLUMN ani_cutscene animation;
+ALTER TABLE releases ADD COLUMN ani_ero_sp animation;
+ALTER TABLE releases ADD COLUMN ani_ero_cg animation;
+ALTER TABLE releases ADD COLUMN ani_bg boolean;
+ALTER TABLE releases ADD COLUMN ani_face boolean;
+
+ALTER TABLE releases_hist ADD COLUMN ani_story_sp animation;
+ALTER TABLE releases_hist ADD COLUMN ani_story_cg animation;
+ALTER TABLE releases_hist ADD COLUMN ani_cutscene animation;
+ALTER TABLE releases_hist ADD COLUMN ani_ero_sp animation;
+ALTER TABLE releases_hist ADD COLUMN ani_ero_cg animation;
+ALTER TABLE releases_hist ADD COLUMN ani_bg boolean;
+ALTER TABLE releases_hist ADD COLUMN ani_face boolean;
+
+UPDATE releases SET ani_story_sp = 0, ani_story_cg = 0, ani_face = false, ani_bg = false WHERE ani_story = 1;
+UPDATE releases_hist SET ani_story_sp = 0, ani_story_cg = 0, ani_face = false, ani_bg = false WHERE ani_story = 1;
+UPDATE releases SET ani_ero_sp = 0, ani_ero_cg = 0 WHERE ani_ero = 1;
+UPDATE releases_hist SET ani_ero_sp = 0, ani_ero_cg = 0 WHERE ani_ero = 1;
+
+ALTER TABLE releases ADD CONSTRAINT releases_cutscene_check CHECK(ani_cutscene <> 0 AND (ani_cutscene & (256+512)) = 0);
+
+\i sql/editfunc.sql
+COMMIT;