Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

chore: add migration file

Scott Wilson22b57b7a7417
diff --git a/backend/src/db/migrations/20250204025010_app-connections-and-secret-syncs-unique-constraint.ts b/backend/src/db/migrations/20250204025010_app-connections-and-secret-syncs-unique-constraint.ts
new file mode 100644
index 0000000000..348694ae7a
--- /dev/null
+++ b/backend/src/db/migrations/20250204025010_app-connections-and-secret-syncs-unique-constraint.ts
@@ -0,0 +1,23 @@
+import { Knex } from "knex";
+
+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 knex.schema.alterTable(TableName.AppConnection, (t) => {
+ t.dropUnique(["orgId", "name"]);
+ });
+
+ await knex.schema.alterTable(TableName.SecretSync, (t) => {
+ t.dropUnique(["projectId", "name"]);
+ });
+}