init
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
import { BaseSchema } from '@adonisjs/lucid/schema'
|
||||
|
||||
export default class extends BaseSchema {
|
||||
protected tableName = 'rate_limits'
|
||||
|
||||
async up() {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.string('key', 255).notNullable().primary()
|
||||
table.integer('points', 9).notNullable().defaultTo(0)
|
||||
table.bigint('expire').unsigned()
|
||||
})
|
||||
}
|
||||
|
||||
async down() {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user