mirror of
https://github.com/Cameri/nostream.git
synced 2025-03-17 13:21:45 +01:00
20 lines
754 B
JavaScript
20 lines
754 B
JavaScript
exports.up = function (knex) {
|
|
return knex.schema.createTable('invoices', (table) => {
|
|
table.uuid('id').primary().defaultTo(knex.raw('uuid_generate_v4()'))
|
|
table.binary('pubkey').notNullable().index()
|
|
table.text('bolt11').notNullable()
|
|
table.bigint('amount_requested').unsigned().notNullable()
|
|
table.bigint('amount_paid').unsigned()
|
|
table.enum('unit', ['msats', 'sats', 'btc'])
|
|
table.enum('status', ['pending', 'completed', 'expired'])
|
|
table.text('description')
|
|
table.datetime('confirmed_at', { useTz: false, precision: 3 })
|
|
table.datetime('expires_at', { useTz: false, precision: 3 })
|
|
table.timestamps(true, true, false)
|
|
})
|
|
}
|
|
|
|
exports.down = function (knex) {
|
|
return knex.schema.dropTable('invoices')
|
|
}
|