Deletions now cascade

This commit is contained in:
Nicolai Ort 2021-08-14 09:32:17 +02:00
parent 71fa977af4
commit 9c23404210
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F
1 changed files with 1 additions and 1 deletions

View File

@ -4,7 +4,7 @@ exports.up = function (knex) {
table.increments('id').primary();
table.timestamp('timestamp').defaultTo(knex.fn.now());
table.string('shortcode').index();
table.foreign('shortcode').references('shortcode').inTable('urls');
table.foreign('shortcode').references('shortcode').inTable('urls').onDelete('CASCADE');
});
};