mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Added migration to add members.geolocation
no issue - prep for storing geolocation of members
This commit is contained in:
parent
b9db9fa15e
commit
f38d490886
3 changed files with 30 additions and 1 deletions
|
@ -0,0 +1,28 @@
|
|||
const commands = require('../../../schema').commands;
|
||||
|
||||
const table = 'members';
|
||||
const column = 'geolocation';
|
||||
|
||||
module.exports.up = commands.createColumnMigration({
|
||||
table,
|
||||
column,
|
||||
dbIsInCorrectState(columnExists) {
|
||||
return columnExists === true;
|
||||
},
|
||||
operation: commands.addColumn,
|
||||
operationVerb: 'Adding'
|
||||
});
|
||||
|
||||
module.exports.down = commands.createColumnMigration({
|
||||
table,
|
||||
column,
|
||||
dbIsInCorrectState(columnExists) {
|
||||
return columnExists === false;
|
||||
},
|
||||
operation: commands.dropColumn,
|
||||
operationVerb: 'Removing'
|
||||
});
|
||||
|
||||
module.exports.config = {
|
||||
transaction: true
|
||||
};
|
|
@ -327,6 +327,7 @@ module.exports = {
|
|||
email: {type: 'string', maxlength: 191, nullable: false, unique: true, validations: {isEmail: true}},
|
||||
name: {type: 'string', maxlength: 191, nullable: true},
|
||||
note: {type: 'string', maxlength: 2000, nullable: true},
|
||||
geolocation: {type: 'string', maxlength: 2000, nullable: true},
|
||||
subscribed: {type: 'bool', nullable: true, defaultTo: true},
|
||||
created_at: {type: 'dateTime', nullable: false},
|
||||
created_by: {type: 'string', maxlength: 24, nullable: false},
|
||||
|
|
|
@ -19,7 +19,7 @@ var should = require('should'),
|
|||
*/
|
||||
describe('DB version integrity', function () {
|
||||
// Only these variables should need updating
|
||||
const currentSchemaHash = '4d65d73126e314a8c05e98990a992201';
|
||||
const currentSchemaHash = '7cd198f085844aa5725964069b051189';
|
||||
const currentFixturesHash = '0ca1c9a6d3dab21d8a1e0b6a988fd83f';
|
||||
|
||||
// If this test is failing, then it is likely a change has been made that requires a DB version bump,
|
||||
|
|
Loading…
Add table
Reference in a new issue