Prefixed stripe_customers_subscriptions with members

no-issue
This commit is contained in:
Fabien O'Carroll 2019-10-09 12:37:57 +07:00
parent 29b3dad302
commit cbb6337ae4
4 changed files with 11 additions and 11 deletions

View File

@ -8,27 +8,27 @@ module.exports = {
async up(options){
const conn = options.transacting || options.connection;
const hasTable = await conn.schema.hasTable('stripe_customers_subscriptions');
const hasTable = await conn.schema.hasTable('members_stripe_customers_subscriptions');
if (hasTable) {
common.logging.warn('Adding table: stripe_customers_subscriptions');
common.logging.warn('Adding table: members_stripe_customers_subscriptions');
return;
}
common.logging.info('Adding table: stripe_customers_subscriptions');
return commands.createTable('stripe_customers_subscriptions', conn);
common.logging.info('Adding table: members_stripe_customers_subscriptions');
return commands.createTable('members_stripe_customers_subscriptions', conn);
},
async down(options){
const conn = options.transacting || options.connection;
const hasTable = await conn.schema.hasTable('stripe_customers_subscriptions');
const hasTable = await conn.schema.hasTable('members_stripe_customers_subscriptions');
if (!hasTable) {
common.logging.warn('Dropping table: stripe_customers_subscriptions');
common.logging.warn('Dropping table: members_stripe_customers_subscriptions');
return;
}
common.logging.info('Dropping table: stripe_customers_subscriptions');
return commands.deleteTable('stripe_customers_subscriptions', conn);
common.logging.info('Dropping table: members_stripe_customers_subscriptions');
return commands.deleteTable('members_stripe_customers_subscriptions', conn);
}
};

View File

@ -403,7 +403,7 @@ module.exports = {
updated_at: {type: 'dateTime', nullable: true},
updated_by: {type: 'string', maxlength: 24, nullable: true}
},
stripe_customers_subscriptions: {
members_stripe_customers_subscriptions: {
id: {type: 'string', maxlength: 24, nullable: false, primary: true},
customer_id: {type: 'string', maxlength: 255, nullable: false, unique: false},
subscription_id: {type: 'string', maxlength: 255, nullable: false, unique: false},

View File

@ -1,7 +1,7 @@
const ghostBookshelf = require('./base');
const StripeCustomerSubscription = ghostBookshelf.Model.extend({
tableName: 'stripe_customers_subscriptions'
tableName: 'members_stripe_customers_subscriptions'
}, {
async upsert(data, unfilteredOptions) {
const subscriptionId = unfilteredOptions.subscription_id;

View File

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