1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-22 14:52:41 +01:00

Make Phame blog policies non-nullable

Summary: Ref T6203. Ref T13661. These policies are incorrectly nullable, although it's likely that no pathway exists in the application to write NULL into them. Fix the schema.

Test Plan: Ran `bin/storage upgrade`.

Subscribers: PHID-OPKG-gm6ozazyms6q6i22gyam

Maniphest Tasks: T13661, T6203

Differential Revision: https://secure.phabricator.com/D21748
This commit is contained in:
epriestley 2022-04-01 11:41:06 -07:00
parent dec95228a2
commit 28b12fb3cd
3 changed files with 12 additions and 4 deletions

View file

@ -0,0 +1,5 @@
UPDATE {$NAMESPACE}_phame.phame_blog
SET editPolicy = 'admin' WHERE editPolicy IS NULL;
ALTER TABLE {$NAMESPACE}_phame.phame_blog
CHANGE editPolicy editPolicy VARBINARY(64) NOT NULL;

View file

@ -0,0 +1,5 @@
UPDATE {$NAMESPACE}_phame.phame_blog
SET viewPolicy = 'admin' WHERE viewPolicy IS NULL;
ALTER TABLE {$NAMESPACE}_phame.phame_blog
CHANGE viewPolicy viewPolicy VARBINARY(64) NOT NULL;

View file

@ -56,10 +56,8 @@ final class PhameBlog extends PhameDAO
'profileImagePHID' => 'phid?',
'headerImagePHID' => 'phid?',
// T6203/NULLABILITY
// These policies should always be non-null.
'editPolicy' => 'policy?',
'viewPolicy' => 'policy?',
'editPolicy' => 'policy',
'viewPolicy' => 'policy',
),
self::CONFIG_KEY_SCHEMA => array(
'key_phid' => null,