From b0de2e1d5b52a856373b482e9ea2f58afabb151e Mon Sep 17 00:00:00 2001 From: Michael Johnson Date: Tue, 30 Jul 2024 10:21:55 -0700 Subject: [PATCH] Remove auth unique constraint --- api/src/data/migrations/029.drop_auth_index.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 api/src/data/migrations/029.drop_auth_index.ts diff --git a/api/src/data/migrations/029.drop_auth_index.ts b/api/src/data/migrations/029.drop_auth_index.ts new file mode 100644 index 0000000..2799dc5 --- /dev/null +++ b/api/src/data/migrations/029.drop_auth_index.ts @@ -0,0 +1,15 @@ +import * as knex from "knex"; + +export async function up(knex: knex.Knex) { + return knex.schema.alterTable("users", (table) => { + table.dropChecks("unique_users_auth_subject") + }); +} + +export async function down(knex: knex.Knex) { + return knex.schema.alterTable("users", (table) => { + table.unique(["auth_subject"], { + indexName: "unique_users_auth_subject", + }); + }); +}