aboutsummaryrefslogtreecommitdiffstats
path: root/rust/migrations/2021-11-17-222046_content_scope/up.sql
blob: bedd087037a02be10473eb46a0fef695488639b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
-- Add `content_scope` field to file, fileset, webcapture

ALTER TABLE file_rev
ADD COLUMN content_scope       TEXT CHECK (octet_length(content_scope) >= 1);

ALTER TABLE fileset_rev
ADD COLUMN content_scope       TEXT CHECK (octet_length(content_scope) >= 1);

ALTER TABLE webcapture_rev
ADD COLUMN content_scope       TEXT CHECK (octet_length(content_scope) >= 1);

-------------------- Update Test Revs --------------------------------------
-- IMPORTANT: don't create new entities here, only mutate existing

BEGIN;

UPDATE file_rev SET content_scope = 'article'
WHERE id = '00000000-0000-0000-3333-FFF000000003';

UPDATE fileset_rev SET content_scope = 'dataset'
WHERE id = '00000000-0000-0000-6666-fff000000003';

UPDATE webcapture_rev SET content_scope = 'webpage'
WHERE id = '00000000-0000-0000-7777-FFF000000003';

COMMIT;