aboutsummaryrefslogtreecommitdiffstats
path: root/db/normalized/vouchers.js
blob: fa5e12a4dda84c23ce7a58d728194b2abd7ccf8f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
exports.up = function(knex) {
  return knex.schema.createTable('vouchers', function(t) {
    t.increments('id').unsigned().primary();

    t.int('invoice_id').notNull();
    t.foreign('invoice_id').references('invoices.id');

    t.string('redemption_code').notNull();
  
    t.enu('status', ['pending', 'redeemed', 'cancelled']).notNull();
  
    t.timestamps();
  })
}

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