aboutsummaryrefslogtreecommitdiffstats
path: root/db/normalized/transactions.js
blob: 7180b8d7f2fa2513850c0dc4d5e93a54d40f7baf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
exports.up = function(knex) {
  return knex.schema.createTable('transactions', function(t) {
      t.increments('id').unsigned().primary();

      t.enu('type', ['deposit', 'withdrawal', 'transfer', 'exchange', 'invoice', 'voucher', 'new asset'])

      // t.text('notes');

      t.timestamps();
  })
};

exports.down = function(knex) {
return knex.schema.dropTable('transactions');
};

// Changes: 
//
// Deposit = deposit + credit
// Withdrawal = withdrawal + debit
// Transfer = credit + debit
// Exchange = credit + debit + debit + credit
// Invoice = invoice + debit ?
// Voucher = invoice + debit ?
// New Asset = liquid_asset + credit

//
// context for path, memo, rate, preimage, address, received, fee, tip, confirmed, redeemcode ?
exports.up = function(knex) {
  return knex.schema.createTable('transactions', function(t) {
    t.increments('id').unsigned().primary();

    t.enu('type', ['deposit', 'withdrawal', 'order', 'transfer', 'invoice', 'voucher'])

    t.timestamps();
  })
};

exports.down = function(knex) {
return knex.schema.dropTable('transactions');
};