Refactored In The Crack. Added chapter videos (unused) and dates. Added stylized entity name field.
This commit is contained in:
50
migrations/20260207034922_chapter_details.js
Normal file
50
migrations/20260207034922_chapter_details.js
Normal file
@@ -0,0 +1,50 @@
|
||||
exports.up = async function(knex) {
|
||||
await knex.schema.alterTable('chapters', (table) => {
|
||||
table.datetime('date');
|
||||
});
|
||||
|
||||
await knex.schema.createTable('chapters_trailers', (table) => {
|
||||
table.integer('chapter_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('chapters')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media')
|
||||
.onDelete('cascade');
|
||||
});
|
||||
|
||||
await knex.schema.createTable('chapters_teasers', (table) => {
|
||||
table.integer('chapter_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('chapters')
|
||||
.onDelete('cascade');
|
||||
|
||||
table.text('media_id')
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media')
|
||||
.onDelete('cascade');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('entities', (table) => {
|
||||
table.string('name_stylized');
|
||||
});
|
||||
};
|
||||
|
||||
exports.down = async function(knex) {
|
||||
await knex.schema.alterTable('chapters', (table) => {
|
||||
table.dropColumn('date');
|
||||
});
|
||||
|
||||
await knex.schema.alterTable('entities', (table) => {
|
||||
table.dropColumn('name_stylized');
|
||||
});
|
||||
|
||||
await knex.schema.dropTable('chapters_trailers');
|
||||
await knex.schema.dropTable('chapters_teasers');
|
||||
};
|
||||
Reference in New Issue
Block a user