mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
migration tweak
This commit is contained in:
@@ -3,10 +3,7 @@ import { Knex } from "knex";
|
||||
import { TableName } from "../schemas";
|
||||
|
||||
export async function up(knex: Knex): Promise<void> {
|
||||
if (
|
||||
(await knex.schema.hasTable(TableName.CertificateBody)) &&
|
||||
!(await knex.schema.hasColumn(TableName.CertificateBody, "encryptedCertificateChain"))
|
||||
) {
|
||||
if (!(await knex.schema.hasColumn(TableName.CertificateBody, "encryptedCertificateChain"))) {
|
||||
await knex.schema.alterTable(TableName.CertificateBody, (t) => {
|
||||
t.binary("encryptedCertificateChain").nullable();
|
||||
});
|
||||
@@ -28,10 +25,7 @@ export async function down(knex: Knex): Promise<void> {
|
||||
await knex.schema.dropTable(TableName.CertificateSecret);
|
||||
}
|
||||
|
||||
if (
|
||||
(await knex.schema.hasTable(TableName.CertificateBody)) &&
|
||||
(await knex.schema.hasColumn(TableName.CertificateBody, "encryptedCertificateChain"))
|
||||
) {
|
||||
if (await knex.schema.hasColumn(TableName.CertificateBody, "encryptedCertificateChain")) {
|
||||
await knex.schema.alterTable(TableName.CertificateBody, (t) => {
|
||||
t.dropColumn("encryptedCertificateChain");
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user