Skip to content

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

feat: added dev migration commands

=45cbd9f00617
diff --git a/backend/package.json b/backend/package.json
index 95896b5c94..2c2fa1d07c 100644
--- a/backend/package.json
+++ b/backend/package.json
@@ -60,6 +60,13 @@
"migration:status": "npm run auditlog-migration:status && knex --knexfile ./dist/db/knexfile.mjs --client pg migrate:status",
"migration:rollback": "npm run auditlog-migration:rollback && knex --knexfile ./dist/db/knexfile.mjs migrate:rollback",
"migration:unlock": "npm run auditlog-migration:unlock && knex --knexfile ./dist/db/knexfile.mjs migrate:unlock",
+ "migration:up-dev": "knex --knexfile ./src/db/knexfile.ts --client pg migrate:up",
+ "migration:down-dev": "knex --knexfile ./src/db/knexfile.ts --client pg migrate:down",
+ "migration:list-dev": "knex --knexfile ./src/db/knexfile.ts --client pg migrate:list",
+ "migration:latest-dev": "knex --knexfile ./src/db/knexfile.ts --client pg migrate:latest",
+ "migration:status-dev": "knex --knexfile ./src/db/knexfile.ts --client pg migrate:status",
+ "migration:rollback-dev": "knex --knexfile ./src/db/knexfile.ts migrate:rollback",
+ "migration:unlock-dev": "knex --knexfile ./src/db/knexfile.ts migrate:unlock",
"migrate:org": "tsx ./scripts/migrate-organization.ts",
"seed:new": "tsx ./scripts/create-seed-file.ts",
"seed": "knex --knexfile ./dist/db/knexfile.ts --client pg seed:run",
diff --git a/backend/src/db/knexfile.ts b/backend/src/db/knexfile.ts
index 8cf80b7445..0e51e94e2f 100644
--- a/backend/src/db/knexfile.ts
+++ b/backend/src/db/knexfile.ts
@@ -39,7 +39,7 @@ export default {
},
migrations: {
tableName: "infisical_migrations",
- loadExtensions: [".mjs"]
+ loadExtensions: [".mjs", ".ts"]
}
},
production: {
@@ -64,7 +64,7 @@ export default {
},
migrations: {
tableName: "infisical_migrations",
- loadExtensions: [".mjs"]
+ loadExtensions: [".mjs", ".ts"]
}
}
} as Knex.Config;