diff options
| author | Adam Soltys <[email protected]> | 2022-09-02 11:02:06 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2022-09-02 11:02:06 -0700 |
| commit | 7a8d64833de8873afb92982b3f5bfff59b30c542 (patch) | |
| tree | bc92e20c7d5127d3b6b17f7b8d3190e08579f49e /db/normalized | |
| parent | b06e117af96a38b163384f6a343f1de7c8996724 (diff) | |
| download | coinos-server-7a8d64833de8873afb92982b3f5bfff59b30c542.tar.gz coinos-server-7a8d64833de8873afb92982b3f5bfff59b30c542.zip | |
es6 migration
Diffstat (limited to 'db/normalized')
| -rw-r--r-- | db/normalized/accounts.js | 6 | ||||
| -rw-r--r-- | db/normalized/bank_accounts.js | 6 | ||||
| -rw-r--r-- | db/normalized/credits.js | 6 | ||||
| -rw-r--r-- | db/normalized/debits.js | 6 | ||||
| -rw-r--r-- | db/normalized/deposits.js | 6 | ||||
| -rw-r--r-- | db/normalized/exchanges.js | 6 | ||||
| -rw-r--r-- | db/normalized/invoices.js | 6 | ||||
| -rw-r--r-- | db/normalized/liquid_assets.js | 6 | ||||
| -rw-r--r-- | db/normalized/ln_keys.js | 6 | ||||
| -rw-r--r-- | db/normalized/lnurl_codes.js | 6 | ||||
| -rw-r--r-- | db/normalized/non_custodial_accounts.js | 7 | ||||
| -rw-r--r-- | db/normalized/orders.js | 7 | ||||
| -rw-r--r-- | db/normalized/referrals.js | 4 | ||||
| -rw-r--r-- | db/normalized/transactions.js | 8 | ||||
| -rw-r--r-- | db/normalized/transfers.js | 6 | ||||
| -rw-r--r-- | db/normalized/user_preferences.js | 6 | ||||
| -rw-r--r-- | db/normalized/user_security.js | 4 | ||||
| -rw-r--r-- | db/normalized/users.js | 4 | ||||
| -rw-r--r-- | db/normalized/vouchers.js | 6 | ||||
| -rw-r--r-- | db/normalized/waiting_list.js | 6 | ||||
| -rw-r--r-- | db/normalized/withdrawals.js | 6 |
21 files changed, 61 insertions, 63 deletions
diff --git a/db/normalized/accounts.js b/db/normalized/accounts.js index 6136d0a0..c6ab1100 100644 --- a/db/normalized/accounts.js +++ b/db/normalized/accounts.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('accounts', function(t) { t.increments('id').unsigned().primary(); t.int('user_id').notNull(); @@ -23,9 +23,9 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('accounts'); }; diff --git a/db/normalized/bank_accounts.js b/db/normalized/bank_accounts.js index 3877ffd3..5d8ea0dc 100644 --- a/db/normalized/bank_accounts.js +++ b/db/normalized/bank_accounts.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('bank_accounts', function(t) { t.increments('id').unsigned().primary(); t.int('user_id').notNull(); @@ -13,9 +13,9 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('user_security'); }; diff --git a/db/normalized/credits.js b/db/normalized/credits.js index 8b8dd5ea..92bf5359 100644 --- a/db/normalized/credits.js +++ b/db/normalized/credits.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('credits', function(t) { t.increments('id').unsigned().primary(); @@ -16,7 +16,7 @@ exports.up = function(knex) { }) }; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('credits'); }; @@ -42,7 +42,7 @@ return knex.schema.dropTable('credits'); // context for path, memo, rate, preimage, address, received, fee, tip, confirmed, redeemcode ? -const { DataTypes } = require('sequelize'); +import { DataTypes } from 'sequelize'; const attributes = { id: { diff --git a/db/normalized/debits.js b/db/normalized/debits.js index 1b65adc6..256853c8 100644 --- a/db/normalized/debits.js +++ b/db/normalized/debits.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('debits', function(t) { t.increments('id').unsigned().primary(); @@ -16,7 +16,7 @@ exports.up = function(knex) { }) }; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('debits'); }; @@ -42,7 +42,7 @@ return knex.schema.dropTable('debits'); // context for path, memo, rate, preimage, address, received, fee, tip, confirmed, redeemcode ? -const { DataTypes } = require('sequelize'); +import { DataTypes } from 'sequelize'; const attributes = { id: { diff --git a/db/normalized/deposits.js b/db/normalized/deposits.js index c14884ce..2a3c83fb 100644 --- a/db/normalized/deposits.js +++ b/db/normalized/deposits.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('deposits', function(t) { t.increments('id').unsigned().primary(); @@ -9,9 +9,9 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('deposits'); }; diff --git a/db/normalized/exchanges.js b/db/normalized/exchanges.js index 3fd0a5ca..2f34a394 100644 --- a/db/normalized/exchanges.js +++ b/db/normalized/exchanges.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('exchanges', function(t) { t.increments('id').unsigned().primary(); @@ -12,7 +12,7 @@ exports.up = function(knex) { }) }; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('exchanges'); }; @@ -38,7 +38,7 @@ return knex.schema.dropTable('exchanges'); // context for path, memo, rate, preimage, address, received, fee, tip, confirmed, redeemcode ? -const { DataTypes } = require('sequelize'); +import { DataTypes } from 'sequelize'; const attributes = { id: { diff --git a/db/normalized/invoices.js b/db/normalized/invoices.js index ec075db8..25f5b681 100644 --- a/db/normalized/invoices.js +++ b/db/normalized/invoices.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('invoices', function(t) { t.increments('id').unsigned().primary(); @@ -27,9 +27,9 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('invoices'); }; diff --git a/db/normalized/liquid_assets.js b/db/normalized/liquid_assets.js index f16712d8..fab96dc5 100644 --- a/db/normalized/liquid_assets.js +++ b/db/normalized/liquid_assets.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('liquid_assets', function(t) { t.increments('id').unsigned().primary(); @@ -14,8 +14,8 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('liquid_assets'); };
\ No newline at end of file diff --git a/db/normalized/ln_keys.js b/db/normalized/ln_keys.js index 74f9ebad..7922e40e 100644 --- a/db/normalized/ln_keys.js +++ b/db/normalized/ln_keys.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('ln_keys', function(t) { t.increments('id').unsigned().primary(); @@ -9,8 +9,8 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('ln_keys'); };
\ No newline at end of file diff --git a/db/normalized/lnurl_codes.js b/db/normalized/lnurl_codes.js index 696b7d44..5ed81135 100644 --- a/db/normalized/lnurl_codes.js +++ b/db/normalized/lnurl_codes.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('lnurl_codes', function(t) { t.increments('id').unsigned().primary(); @@ -7,8 +7,8 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('lnurl_codes'); }; diff --git a/db/normalized/non_custodial_accounts.js b/db/normalized/non_custodial_accounts.js index ad573bc2..5c56b966 100644 --- a/db/normalized/non_custodial_accounts.js +++ b/db/normalized/non_custodial_accounts.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('non_custodial_accounts', function(t) { t.increments('id').unsigned().primary(); t.int('account_id').notNull(); @@ -14,10 +14,9 @@ exports.up = function(knex) { t.timestamps(); }) -} - +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('non_custodial_accounts'); }; diff --git a/db/normalized/orders.js b/db/normalized/orders.js index 8d8418b6..06e83db1 100644 --- a/db/normalized/orders.js +++ b/db/normalized/orders.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('orders', function(t) { t.increments('id').unsigned().primary(); @@ -19,12 +19,11 @@ exports.up = function(knex) { t.timestamps(); }) -} - +}; // Bid / Accepted ... separate into Bid (credit + debit), Accepted (credit + debit) -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('orders'); }; diff --git a/db/normalized/referrals.js b/db/normalized/referrals.js index f09c98f4..7380f2cf 100644 --- a/db/normalized/referrals.js +++ b/db/normalized/referrals.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('referrals', function(t) { t.increments('id').unsigned().primary(); t.int('user_id').nullable(); @@ -15,6 +15,6 @@ exports.up = function(knex) { }) }; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('referrals'); }; diff --git a/db/normalized/transactions.js b/db/normalized/transactions.js index 7180b8d7..230faca4 100644 --- a/db/normalized/transactions.js +++ b/db/normalized/transactions.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('transactions', function(t) { t.increments('id').unsigned().primary(); @@ -10,7 +10,7 @@ exports.up = function(knex) { }) }; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('transactions'); }; @@ -26,7 +26,7 @@ return knex.schema.dropTable('transactions'); // // context for path, memo, rate, preimage, address, received, fee, tip, confirmed, redeemcode ? -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('transactions', function(t) { t.increments('id').unsigned().primary(); @@ -36,6 +36,6 @@ exports.up = function(knex) { }) }; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('transactions'); };
\ No newline at end of file diff --git a/db/normalized/transfers.js b/db/normalized/transfers.js index cefc66f7..aa81472f 100644 --- a/db/normalized/transfers.js +++ b/db/normalized/transfers.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('transfers', function(t) { t.increments('id').unsigned().primary(); @@ -23,7 +23,7 @@ exports.up = function(knex) { }) }; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('transfers'); }; @@ -49,7 +49,7 @@ return knex.schema.dropTable('transfers'); // context for path, memo, rate, preimage, address, received, fee, tip, confirmed, redeemcode ? -const { DataTypes } = require('sequelize'); +import { DataTypes } from 'sequelize'; const attributes = { id: { diff --git a/db/normalized/user_preferences.js b/db/normalized/user_preferences.js index 36956dc0..6af69f3f 100644 --- a/db/normalized/user_preferences.js +++ b/db/normalized/user_preferences.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('user_preferences', function(t) { t.increments('id').unsigned().primary(); t.int('user_id').notNull(); @@ -13,8 +13,8 @@ exports.up = function(knex) { // knex.raw("ALTER TABLE users MODIFY `subscriptions` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL") }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('user_preferences'); }; diff --git a/db/normalized/user_security.js b/db/normalized/user_security.js index 09afa7c6..919b2902 100644 --- a/db/normalized/user_security.js +++ b/db/normalized/user_security.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('user_security', function(t) { t.increments('id').unsigned().primary(); t.int('user_id').notNull(); @@ -17,6 +17,6 @@ exports.up = function(knex) { }) }; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('user_security'); };
\ No newline at end of file diff --git a/db/normalized/users.js b/db/normalized/users.js index 2c2004c0..dd239f24 100644 --- a/db/normalized/users.js +++ b/db/normalized/users.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('users', function(t) { t.increments('id').unsigned().primary(); @@ -13,6 +13,6 @@ exports.up = function(knex) { }) }; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('users'); };
\ No newline at end of file diff --git a/db/normalized/vouchers.js b/db/normalized/vouchers.js index fa5e12a4..35d54de2 100644 --- a/db/normalized/vouchers.js +++ b/db/normalized/vouchers.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('vouchers', function(t) { t.increments('id').unsigned().primary(); @@ -11,8 +11,8 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('vouchers'); };
\ No newline at end of file diff --git a/db/normalized/waiting_list.js b/db/normalized/waiting_list.js index 42ec57a7..f6908868 100644 --- a/db/normalized/waiting_list.js +++ b/db/normalized/waiting_list.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('waiting_list', function(t) { t.increments('id').unsigned().primary(); @@ -8,9 +8,9 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('waiting_list'); }; diff --git a/db/normalized/withdrawals.js b/db/normalized/withdrawals.js index 9a45c514..d404e6e3 100644 --- a/db/normalized/withdrawals.js +++ b/db/normalized/withdrawals.js @@ -1,4 +1,4 @@ -exports.up = function(knex) { +export const up = function(knex) { return knex.schema.createTable('withdrawals', function(t) { t.increments('id').unsigned().primary(); @@ -14,9 +14,9 @@ exports.up = function(knex) { t.timestamps(); }) -} +}; -exports.down = function(knex) { +export const down = function(knex) { return knex.schema.dropTable('withdrawals'); }; |
