billing_unlock.cjs
571 Bytes
const tableName = 'billing_unlock'
function buildTable(t) {
t.string('id', 64).primary()
t.string('user_id', 64).notNullable()
t.string('content_id', 96).notNullable()
t.string('target_key', 191).notNullable()
t.string('ledger_id', 64).nullable()
t.string('target_kind', 32).nullable()
t.datetime('created_at', { precision: 3 }).notNullable()
t.index(['user_id', 'content_id'], 'idx_billing_unlock_user_content')
t.unique(['user_id', 'content_id', 'target_key'], { indexName: 'uq_billing_unlock_target' })
}
module.exports = { tableName, buildTable }