react-code-dataset / spectrum /api /migrations /20180320122000-create-stripe-tables.js
Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
exports.up = function(r, conn) {
const createCustomersTable = () =>
r.tableCreate('stripeCustomers', { primaryKey: 'customerId' }).run(conn);
const createInvoicesTable = () =>
r.tableCreate('stripeInvoices', { primaryKey: 'invoiceId' }).run(conn);
return Promise.all([createCustomersTable(), createInvoicesTable()])
.then(() =>
Promise.all([
r
.table('stripeInvoices')
.indexCreate('customerId')
.run(conn),
])
)
.catch(err => console.log(err));
};
exports.down = function(r, conn) {
return Promise.all([
r.tableDrop('stripeCustomers').run(conn),
r.tableDrop('stripeInvoices').run(conn),
]);
};