Repository navigation
Create initial migration, model, factory, and test for suspending wikis - #1294
outdooracorn wants to merge 1 commit into
Conversation
The relationship between the `review_submission_actions` and `wiki_suspension_actions` tables could be represented as a foreign key column on either table. Bug: T440875
1c61bc9 to
6e7cde0
Compare
tarrow
left a comment
There was a problem hiding this comment.
Looks fine to me. 2 comments and I guess two "nudges" for how I would handle your todos
| namespace App\Enums; | ||
|
|
||
| enum WikiSuspensionActionReason: string { | ||
| case DEFAULT_EXPIRY = 'default_expiry'; |
There was a problem hiding this comment.
I know we were originally not keen but I think keeping this here and inserting it is expedient
| namespace App\Enums; | ||
|
|
||
| enum WikiSuspensionActionType: string { | ||
| case SUSPEND = 'suspend'; |
There was a problem hiding this comment.
good idea to also make this an enum
| ->restrictOnUpdate() | ||
| ->restrictOnDelete(); | ||
|
|
||
| $table->dateTime('active_from'); |
There was a problem hiding this comment.
My current thinking is that this should either be nullable or we add a field to the enum like indefinitely_allowed.
my preference is we add indefinitely_allowed.
This does annoyingly nudge me to thinking that the layout is still a bit ugly and keeping suspensions right next to unsuspensions isn't that elegant. I think we should go ahead anyway though.
| // relationship on this table will mean it doesn't need to be updated once the WikiSuspensionAction exits. | ||
| // | ||
| // TODO: is this a one-to-one or a one-to-many relationship? | ||
| // - if it is a one-to-one relationship then the foreign key column can be added to either column |
There was a problem hiding this comment.
I think I favour a one-to-one model for now. Adding uniqueness does seem wise so we are explicit if we change it in future.
Trying not to get philosophical: a second suspension action added later doesn't seem strongly connecting to a reviewsubmissionaction
Bug: T440875
Stack created with GitHub Stacks CLI • Give Feedback 💬