Files
kener/migrations/20260114120000_remove_monitors_name_unique.ts
T
2026-01-22 11:19:13 +05:30

16 lines
430 B
TypeScript

import type { Knex } from "knex";
export async function up(knex: Knex): Promise<void> {
// Remove unique constraint from monitors.name
await knex.schema.alterTable("monitors", (table) => {
table.dropUnique(["name"]);
});
}
export async function down(knex: Knex): Promise<void> {
// Re-add unique constraint to monitors.name
await knex.schema.alterTable("monitors", (table) => {
table.unique(["name"]);
});
}