forked from DebaucheryLibrarian/traxxx
Updated Gaywire configuration, moved from Bang Bros to Aylo.
This commit is contained in:
31
migrations/20240822005656_entity_tags_cascade.js
Normal file
31
migrations/20240822005656_entity_tags_cascade.js
Normal file
@@ -0,0 +1,31 @@
|
||||
exports.up = async (knex) => {
|
||||
await knex.schema.alterTable('entities_tags', (table) => {
|
||||
table.dropForeign('tag_id');
|
||||
table.dropForeign('entity_id');
|
||||
|
||||
table.foreign('tag_id')
|
||||
.references('id')
|
||||
.inTable('tags')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.foreign('entity_id')
|
||||
.references('id')
|
||||
.inTable('entities')
|
||||
.onDelete('cascade');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async (knex) => {
|
||||
await knex.schema.alterTable('entities_tags', (table) => {
|
||||
table.dropForeign('tag_id');
|
||||
table.dropForeign('entity_id');
|
||||
|
||||
table.foreign('tag_id')
|
||||
.references('id')
|
||||
.inTable('tags');
|
||||
|
||||
table.foreign('entity_id')
|
||||
.references('id')
|
||||
.inTable('entities');
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user