Files
paprika-api/database/migrations/1748802217892_create_rate_limits_table.ts
T
2025-07-18 10:27:33 +02:00

17 lines
437 B
TypeScript

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)
}
}