feat(infisical-pg): fixed radix issue, bugs in oauth and tag cascade on

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:23 +05:30
parent 92f7b45e01
commit c880a48749
14 changed files with 4815 additions and 44627 deletions
+11 -3
View File
@@ -6,14 +6,22 @@ export const createJunctionTable = (
knex: Knex,
tableName: TableName,
table1Name: TableName,
table2Name: TableName
table2Name: TableName,
) =>
knex.schema.createTable(tableName, (table) => {
table.uuid("id", { primaryKey: true }).defaultTo(knex.fn.uuid());
table.uuid(`${table1Name}Id`).unsigned().notNullable(); // Foreign key for table1
table.uuid(`${table2Name}Id`).unsigned().notNullable(); // Foreign key for table2
table.foreign(`${table1Name}Id`).references("id").inTable(table1Name);
table.foreign(`${table2Name}Id`).references("id").inTable(table2Name);
table
.foreign(`${table1Name}Id`)
.references("id")
.inTable(table1Name)
.onDelete("CASCADE");
table
.foreign(`${table2Name}Id`)
.references("id")
.inTable(table2Name)
.onDelete("CASCADE");
});
// one time logic