Skip to content

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

misc: made identity metadata value not nullable

Sheen Capadnganc41d27e1aeab
diff --git a/backend/src/db/migrations/20241121131344_make-identity-metadata-not-nullable-again.ts b/backend/src/db/migrations/20241121131344_make-identity-metadata-not-nullable-again.ts
new file mode 100644
index 0000000000..fb58c02df1
--- /dev/null
+++ b/backend/src/db/migrations/20241121131344_make-identity-metadata-not-nullable-again.ts
@@ -0,0 +1,20 @@
+import { Knex } from "knex";
+
+import { TableName } from "../schemas";
+
+export async function up(knex: Knex): Promise<void> {
+ if (await knex.schema.hasColumn(TableName.IdentityMetadata, "value")) {
+ await knex(TableName.IdentityMetadata).whereNull("value").delete();
+ await knex.schema.alterTable(TableName.IdentityMetadata, (t) => {
+ t.string("value", 1020).notNullable().alter();
+ });
+ }
+}
+
+export async function down(knex: Knex): Promise<void> {
+ if (await knex.schema.hasColumn(TableName.IdentityMetadata, "value")) {
+ await knex.schema.alterTable(TableName.IdentityMetadata, (t) => {
+ t.string("value", 1020).alter();
+ });
+ }
+}