diff options
| author | Adam Soltys <[email protected]> | 2023-01-08 21:05:34 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-01-08 21:05:34 -0800 |
| commit | dce07aa93b3c2f47aca0c24cea6adde9ec37f1a7 (patch) | |
| tree | 6c6b8930ebe9c2cc5b8d1f759e61260f509fdd7a /db/normalized/exchanges.js | |
| parent | f7b844883506a8072213245b9b8a2b988694e4f5 (diff) | |
| download | coinos-server-dce07aa93b3c2f47aca0c24cea6adde9ec37f1a7.tar.gz coinos-server-dce07aa93b3c2f47aca0c24cea6adde9ec37f1a7.zip | |
tech debt jubilee
Diffstat (limited to 'db/normalized/exchanges.js')
| -rw-r--r-- | db/normalized/exchanges.js | 232 |
1 files changed, 0 insertions, 232 deletions
diff --git a/db/normalized/exchanges.js b/db/normalized/exchanges.js deleted file mode 100644 index 2be91990..00000000 --- a/db/normalized/exchanges.js +++ /dev/null @@ -1,232 +0,0 @@ -export const up = function(knex) { - return knex.schema.createTable('exchanges', function(t) { - t.increments('id').unsigned().primary(); - - t.int('transfer_id').notNull(); - t.foreign('transfer_id').references('transfers.id'); - - t.double('exchange_rate').notNull() - t.double('exchange_fee').notNull().defaultTo(0) - - t.timestamps(); - }) -}; - -export const down = function(knex) { -return knex.schema.dropTable('exchanges'); -}; - -// Changes: -// -// Should these be tracked as transactions ? -// SAT -> SAT -// tracking various exchange variations (outside of external networks ?) -// -// Is user / account / amount info redundant ? -// + transaction_type: deposit / withdrawal / transfer / exchange ? -// -// add transfers table ? (for internal transfers only ?) -// add redemptions table ? (for bitcoin transfers only ?) -// add exchanges table ? (for conversion from one currency to another) -// -// network -> scope: internal / bitcoin / liquid / lightning ? -// add bitcoin_transaction ? (with redemption attributes) -// add liquid_transaction ? () -// add lightning_transaction ? (with LN_invoice_hash) -// add internal_transaction ? () -// -// context for path, memo, rate, preimage, address, received, fee, tip, confirmed, redeemcode ? - - -import { DataTypes } from '@sequelize/core'; - -const attributes = { - id: { - type: DataTypes.INTEGER(11), - allowNull: false, - defaultValue: null, - primaryKey: true, - autoIncrement: true, - comment: null, - field: "id" - }, - account_id: { - type: DataTypes.INTEGER(11), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "account_id" - }, - user_id: { - type: DataTypes.INTEGER(11), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "user_id" - }, - path: { - type: DataTypes.STRING(255), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "path" - }, - memo: { - type: DataTypes.TEXT, - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "memo" - }, - hash: { - type: DataTypes.TEXT, - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "hash" - }, - createdAt: { - type: DataTypes.DATE, - allowNull: false, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "createdAt" - }, - updatedAt: { - type: DataTypes.DATE, - allowNull: false, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "updatedAt" - }, - rate: { - type: DataTypes.DOUBLE, - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "rate" - }, - preimage: { - type: DataTypes.STRING(255), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "preimage" - }, - network: { - type: DataTypes.STRING(255), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "network" - }, - currency: { - type: DataTypes.STRING(255), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "currency" - }, - address: { - type: DataTypes.STRING(255), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "address" - }, - received: { - type: DataTypes.INTEGER(1), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "received" - }, - amount: { - type: DataTypes.DOUBLE, - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "amount" - }, - fee: { - type: DataTypes.DOUBLE, - allowNull: false, - defaultValue: 0, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "fee" - }, - tip: { - type: DataTypes.DOUBLE, - allowNull: false, - defaultValue: 0, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "tip" - }, - redeemed: { - type: DataTypes.BOOLEAN, - allowNull: false, - defaultValue: false, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "redeemed" - }, - redeemcode: { - type: DataTypes.STRING(255), - allowNull: true, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "redeemcode" - }, - confirmed: { - type: DataTypes.INTEGER(1), - allowNull: false, - defaultValue: null, - primaryKey: false, - autoIncrement: false, - comment: null, - field: "confirmed" - } -}; - -const options = { - tableName: "payments", - comment: "", - indexes: [] -}; - -db["Payment"] = db.define("payments_model", attributes, options); |
