wikipedia-game-solver/apps/api/database/migrations/1723465492674_create_rate_limits_table.ts

18 lines
532 B
TypeScript
Raw Permalink Normal View History

2024-08-12 15:13:24 +02:00
import { BaseSchema } from "@adonisjs/lucid/schema"
export default class CreateRateLimitsTable extends BaseSchema {
protected tableName = "rate_limits"
public override async up(): Promise<void> {
void this.schema.createTable(this.tableName, (table) => {
table.string("key", 255).notNullable().primary()
table.integer("points", 9).notNullable().defaultTo(0)
table.bigint("expire").unsigned()
})
}
public override async down(): Promise<void> {
void this.schema.dropTable(this.tableName)
}
}