mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-19 14:33:52 +00:00
23 lines
701 B
TypeScript
23 lines
701 B
TypeScript
import { Knex } from "knex";
|
|
|
|
import { dropConstraintIfExists } from "@app/db/migrations/utils/dropConstraintIfExists";
|
|
import { TableName } from "@app/db/schemas";
|
|
|
|
export async function up(knex: Knex): Promise<void> {
|
|
await knex.schema.alterTable(TableName.AppConnection, (t) => {
|
|
t.unique(["orgId", "name"]);
|
|
});
|
|
|
|
await knex.schema.alterTable(TableName.SecretSync, (t) => {
|
|
t.unique(["projectId", "name"]);
|
|
});
|
|
}
|
|
|
|
export async function down(knex: Knex): Promise<void> {
|
|
await dropConstraintIfExists(TableName.AppConnection, "app_connections_orgid_name_unique", knex);
|
|
|
|
await knex.schema.alterTable(TableName.SecretSync, (t) => {
|
|
t.dropUnique(["projectId", "name"]);
|
|
});
|
|
}
|