mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
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:
parent
c9b4fa4a09
commit
d54be917d1
@ -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
|
||||
}
|
||||
};
|
@ -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},
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user