mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-10-06 22:27:22 +00:00
only create triggers when create new table
This commit is contained in:
@@ -13,9 +13,9 @@ export async function up(knex: Knex): Promise<void> {
|
|||||||
t.string("name").notNullable();
|
t.string("name").notNullable();
|
||||||
t.string("description").notNullable();
|
t.string("description").notNullable();
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
await createOnUpdateTrigger(knex, TableName.PkiCollection);
|
await createOnUpdateTrigger(knex, TableName.PkiCollection);
|
||||||
|
}
|
||||||
|
|
||||||
if (!(await knex.schema.hasTable(TableName.PkiCollectionItem))) {
|
if (!(await knex.schema.hasTable(TableName.PkiCollectionItem))) {
|
||||||
await knex.schema.createTable(TableName.PkiCollectionItem, (t) => {
|
await knex.schema.createTable(TableName.PkiCollectionItem, (t) => {
|
||||||
@@ -28,9 +28,9 @@ export async function up(knex: Knex): Promise<void> {
|
|||||||
t.uuid("certId").nullable();
|
t.uuid("certId").nullable();
|
||||||
t.foreign("certId").references("id").inTable(TableName.Certificate).onDelete("CASCADE");
|
t.foreign("certId").references("id").inTable(TableName.Certificate).onDelete("CASCADE");
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
await createOnUpdateTrigger(knex, TableName.PkiCollectionItem);
|
await createOnUpdateTrigger(knex, TableName.PkiCollectionItem);
|
||||||
|
}
|
||||||
|
|
||||||
if (!(await knex.schema.hasTable(TableName.PkiAlert))) {
|
if (!(await knex.schema.hasTable(TableName.PkiAlert))) {
|
||||||
await knex.schema.createTable(TableName.PkiAlert, (t) => {
|
await knex.schema.createTable(TableName.PkiAlert, (t) => {
|
||||||
@@ -45,9 +45,9 @@ export async function up(knex: Knex): Promise<void> {
|
|||||||
t.string("recipientEmails").notNullable();
|
t.string("recipientEmails").notNullable();
|
||||||
t.unique(["name", "projectId"]);
|
t.unique(["name", "projectId"]);
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
await createOnUpdateTrigger(knex, TableName.PkiAlert);
|
await createOnUpdateTrigger(knex, TableName.PkiAlert);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function down(knex: Knex): Promise<void> {
|
export async function down(knex: Knex): Promise<void> {
|
||||||
|
|||||||
Reference in New Issue
Block a user