Added name column back to members table (#11151)

refs 294f3769cb

- We have a need for name field now :)
- This time `name` is nullable !
This commit is contained in:
Naz Gargol 2019-09-25 10:44:50 +02:00 committed by GitHub
parent c9b4fa4a09
commit d54be917d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,28 @@
const commands = require('../../../schema').commands;
module.exports = {
up: commands.createColumnMigration({
table: 'members',
column: 'name',
dbIsInCorrectState(hasColumn) {
return hasColumn === true;
},
operation: commands.addColumn,
operationVerb: 'Adding'
}),
down: commands.createColumnMigration({
table: 'members',
column: 'name',
dbIsInCorrectState(hasColumn) {
return hasColumn === false;
},
operation: commands.dropColumn,
operationVerb: 'Dropping'
}),
config: {
transaction: true
}
};

View File

@ -385,6 +385,7 @@ module.exports = {
members: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
email: {type: 'string', maxlength: 191, nullable: false, unique: true, validations: {isEmail: true}},
name: {type: 'string', maxlength: 191, nullable: true},
created_at: {type: 'dateTime', nullable: false},
created_by: {type: 'string', maxlength: 24, nullable: false},
updated_at: {type: 'dateTime', nullable: true},

View File

@ -19,7 +19,7 @@ var should = require('should'),
*/
describe('DB version integrity', function () {
// Only these variables should need updating
const currentSchemaHash = '988ec6aa45840b4d15e16d5b1d2a9976';
const currentSchemaHash = 'a503d46e2333202f00fa2bc835b064d2';
const currentFixturesHash = 'c7b485fe2f16517295bd35c761129729';
// If this test is failing, then it is likely a change has been made that requires a DB version bump,