mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-19 22:20:36 +00:00
Add missing downgrade
This commit is contained in:
@@ -21,7 +21,8 @@ export async function up(knex: Knex): Promise<void> {
|
||||
t.foreign("acmeConfigId").references("id").inTable(TableName.PkiAcmeEnrollmentConfig).onDelete("SET NULL");
|
||||
t.index("acmeConfigId");
|
||||
});
|
||||
// TODO: should update (or add?) the constraints to check at least one of the enrollment config id is set
|
||||
// TODO: should update (or add?) the constraints to check at least one of
|
||||
// the enrollment config id is set and it matches the enrollment type?
|
||||
}
|
||||
|
||||
// Create PkiAcmeAccount table
|
||||
@@ -120,6 +121,14 @@ export async function up(knex: Knex): Promise<void> {
|
||||
export async function down(knex: Knex): Promise<void> {
|
||||
// Drop tables in reverse dependency order
|
||||
|
||||
if (await knex.schema.hasColumn(TableName.PkiCertificateProfile, "acmeConfigId")) {
|
||||
await knex.schema.alterTable(TableName.PkiCertificateProfile, (t) => {
|
||||
t.dropForeign(["acmeConfigId"]);
|
||||
t.dropIndex("acmeConfigId");
|
||||
t.dropColumn("acmeConfigId");
|
||||
});
|
||||
}
|
||||
|
||||
// Drop PkiAcmeChallenge first (depends on PkiAcmeAuth)
|
||||
if (await knex.schema.hasTable(TableName.PkiAcmeChallenge)) {
|
||||
await knex.schema.dropTable(TableName.PkiAcmeChallenge);
|
||||
|
||||
Reference in New Issue
Block a user