Added validations to table creation

- These are not enforced at the DB level, so don't matter here, but adding for consistency / cleanliness
This commit is contained in:
Hannah Wolfe 2022-04-25 12:15:34 +01:00 committed by Matt Hanley
parent 37a684c2c5
commit 61dc52972f

View File

@ -8,7 +8,7 @@ module.exports = recreateTable('newsletters', {
sender_name: {type: 'string', maxlength: 191, nullable: false}, sender_name: {type: 'string', maxlength: 191, nullable: false},
sender_email: {type: 'string', maxlength: 191, nullable: true}, sender_email: {type: 'string', maxlength: 191, nullable: true},
sender_reply_to: {type: 'string', maxlength: 191, nullable: false, defaultTo: 'newsletter', validations: {isIn: [['newsletter', 'support']]}}, sender_reply_to: {type: 'string', maxlength: 191, nullable: false, defaultTo: 'newsletter', validations: {isIn: [['newsletter', 'support']]}},
status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'active'}, status: {type: 'string', maxlength: 50, nullable: false, defaultTo: 'active', validations: {isIn: [['active', 'archived']]}},
visibility: { visibility: {
type: 'string', type: 'string',
maxlength: 50, maxlength: 50,