Download spectrum/api/migrations/20180320122000-create-stripe-tables.js from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 685 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/migrations/20180320122000-create-stripe-tables.js
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/spectrum/api/migrations/20180320122000-create-stripe-tables.js
-
curl -L -o 20180320122000-create-stripe-tables.js https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/spectrum/api/migrations/20180320122000-create-stripe-tables.js
685 Bytes
| 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), | |
| ]); | |
| }; | |