mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 14:43:08 +03:00
Prefixed stripe_customers_subscriptions with members
no-issue
This commit is contained in:
parent
29b3dad302
commit
cbb6337ae4
@ -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);
|
||||
}
|
||||
};
|
||||
|
@ -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},
|
||||
|
@ -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;
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user