database
: Allow meta_subjects.subject
to be null
This commit is contained in:
parent
17a0dfd21d
commit
1322023e23
2 changed files with 15 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
|||
UPDATE meta_subjects SET subject = 'invalid:subject.null' WHERE subject IS NULL;
|
||||
|
||||
ALTER TABLE meta_subjects ALTER subject SET NOT NULL;
|
||||
|
||||
ALTER TABLE meta_subjects ADD CONSTRAINT either_subject_or_redirect_not_null
|
||||
CHECK (
|
||||
(subject IS NOT NULL AND redirect IS NULL)
|
||||
OR
|
||||
(subject IS NULL AND redirect IS NOT NULL)
|
||||
);
|
|
@ -0,0 +1,5 @@
|
|||
ALTER TABLE meta_subjects DROP CONSTRAINT either_subject_or_redirect_not_null;
|
||||
|
||||
ALTER TABLE meta_subjects ALTER subject DROP NOT NULL;
|
||||
|
||||
UPDATE meta_subjects SET subject = NULL WHERE subject = 'invalid:subject.null';
|
Loading…
Reference in a new issue