mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 00:32:42 +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:
parent
dec95228a2
commit
28b12fb3cd
3 changed files with 12 additions and 4 deletions
5
resources/sql/autopatches/20220401.phameinteract.01.sql
Normal file
5
resources/sql/autopatches/20220401.phameinteract.01.sql
Normal 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;
|
5
resources/sql/autopatches/20220401.phameinteract.02.sql
Normal file
5
resources/sql/autopatches/20220401.phameinteract.02.sql
Normal 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;
|
|
@ -56,10 +56,8 @@ final class PhameBlog extends PhameDAO
|
||||||
'profileImagePHID' => 'phid?',
|
'profileImagePHID' => 'phid?',
|
||||||
'headerImagePHID' => 'phid?',
|
'headerImagePHID' => 'phid?',
|
||||||
|
|
||||||
// T6203/NULLABILITY
|
'editPolicy' => 'policy',
|
||||||
// These policies should always be non-null.
|
'viewPolicy' => 'policy',
|
||||||
'editPolicy' => 'policy?',
|
|
||||||
'viewPolicy' => 'policy?',
|
|
||||||
),
|
),
|
||||||
self::CONFIG_KEY_SCHEMA => array(
|
self::CONFIG_KEY_SCHEMA => array(
|
||||||
'key_phid' => null,
|
'key_phid' => null,
|
||||||
|
|
Loading…
Reference in a new issue