summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2009-07-19 11:36:54 +0200
committerYorhel <git@yorhel.nl>2009-07-19 11:36:54 +0200
commit678a78d71534441d5471ed24aa8b471ba08c6664 (patch)
treeba79c25216a87b7f56d71f864ed641d8a91222e4 /util
parent4df0638b6f615489bd946c03753b3bbe0269e3b2 (diff)
Converted and renamed screenshots.status (int) to processed (bool)
There were only two states, processed and unprocessed, so simply using a boolean column with correct naming is more clarifying.
Diffstat (limited to 'util')
-rw-r--r--util/dump.sql2
-rw-r--r--util/updates/update_2.6.sql9
2 files changed, 10 insertions, 1 deletions
diff --git a/util/dump.sql b/util/dump.sql
index 583212cd..003c33ea 100644
--- a/util/dump.sql
+++ b/util/dump.sql
@@ -156,7 +156,7 @@ CREATE TABLE rlists (
-- screenshots
CREATE TABLE screenshots (
id SERIAL NOT NULL PRIMARY KEY,
- status smallint NOT NULL DEFAULT 0,
+ processed boolean NOT NULL DEFAULT FALSE,
width smallint NOT NULL DEFAULT 0,
height smallint NOT NULL DEFAULT 0
);
diff --git a/util/updates/update_2.6.sql b/util/updates/update_2.6.sql
index 8cd0962a..a2fa5b32 100644
--- a/util/updates/update_2.6.sql
+++ b/util/updates/update_2.6.sql
@@ -34,6 +34,15 @@ ALTER TABLE anime ALTER COLUMN year DROP DEFAULT;
UPDATE anime SET year = NULL WHERE year = 0;
+
+-- screenshots.status (smallint) -> screenshots.processed (boolean)
+ALTER TABLE screenshots RENAME COLUMN status TO processed;
+ALTER TABLE screenshots ALTER COLUMN processed DROP DEFAULT;
+ALTER TABLE screenshots ALTER COLUMN processed TYPE boolean USING processed::int::boolean;
+ALTER TABLE screenshots ALTER COLUMN processed SET DEFAULT FALSE;
+
+
+
-- automatically insert rows into the anime table for unknown aids
-- when inserted into vn_anime
CREATE OR REPLACE FUNCTION vn_anime_aid() RETURNS trigger AS $$