forked from DebaucheryLibrarian/traxxx
Added chapters and shoot location. Added In The Crack.
This commit is contained in:
@@ -614,6 +614,7 @@ exports.up = knex => Promise.resolve()
|
||||
|
||||
table.text('shoot_id');
|
||||
table.text('entry_id');
|
||||
|
||||
table.unique(['entity_id', 'entry_id']);
|
||||
|
||||
table.text('url', 1000);
|
||||
@@ -625,6 +626,13 @@ exports.up = knex => Promise.resolve()
|
||||
|
||||
table.date('production_date');
|
||||
|
||||
table.text('production_location');
|
||||
table.text('production_city');
|
||||
table.text('production_state');
|
||||
table.text('production_country_alpha2', 2)
|
||||
.references('alpha2')
|
||||
.inTable('countries');
|
||||
|
||||
table.enum('date_precision', ['year', 'month', 'day', 'hour', 'minute', 'second'])
|
||||
.defaultTo('day');
|
||||
|
||||
@@ -821,7 +829,7 @@ exports.up = knex => Promise.resolve()
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('movies_covers', (table) => {
|
||||
table.integer('release_id', 16)
|
||||
table.integer('movie_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('movies');
|
||||
@@ -831,10 +839,10 @@ exports.up = knex => Promise.resolve()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique(['release_id', 'media_id']);
|
||||
table.unique(['movie_id', 'media_id']);
|
||||
}))
|
||||
.then(() => knex.schema.createTable('movies_trailers', (table) => {
|
||||
table.integer('release_id', 16)
|
||||
table.integer('movie_id', 16)
|
||||
.unique()
|
||||
.notNullable()
|
||||
.references('id')
|
||||
@@ -845,6 +853,74 @@ exports.up = knex => Promise.resolve()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('chapters', (table) => {
|
||||
table.increments('id', 16);
|
||||
|
||||
table.integer('release_id', 12)
|
||||
.references('id')
|
||||
.inTable('releases')
|
||||
.notNullable();
|
||||
|
||||
table.integer('chapter', 6);
|
||||
|
||||
table.unique(['release_id', 'chapter']);
|
||||
|
||||
table.text('title');
|
||||
table.text('description');
|
||||
|
||||
table.integer('duration')
|
||||
.unsigned();
|
||||
|
||||
table.integer('created_batch_id', 12)
|
||||
.references('id')
|
||||
.inTable('batches');
|
||||
|
||||
table.integer('updated_batch_id', 12)
|
||||
.references('id')
|
||||
.inTable('batches');
|
||||
|
||||
table.datetime('created_at')
|
||||
.defaultTo(knex.fn.now());
|
||||
}))
|
||||
.then(() => knex.schema.createTable('chapters_posters', (table) => {
|
||||
table.integer('chapter_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('chapters');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique('chapter_id');
|
||||
}))
|
||||
.then(() => knex.schema.createTable('chapters_photos', (table) => {
|
||||
table.integer('chapter_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('chapters');
|
||||
|
||||
table.text('media_id', 21)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('media');
|
||||
|
||||
table.unique(['chapter_id', 'media_id']);
|
||||
}))
|
||||
.then(() => knex.schema.createTable('chapters_tags', (table) => {
|
||||
table.integer('tag_id', 12)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('tags');
|
||||
|
||||
table.integer('chapter_id', 16)
|
||||
.notNullable()
|
||||
.references('id')
|
||||
.inTable('chapters');
|
||||
|
||||
table.unique(['tag_id', 'chapter_id']);
|
||||
}))
|
||||
// SEARCH
|
||||
.then(() => { // eslint-disable-line arrow-body-style
|
||||
// allow vim fold
|
||||
@@ -1024,6 +1100,10 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
||||
DROP TABLE IF EXISTS movies_scenes CASCADE;
|
||||
DROP TABLE IF EXISTS movies_trailers CASCADE;
|
||||
|
||||
DROP TABLE IF EXISTS chapters_tags CASCADE;
|
||||
DROP TABLE IF EXISTS chapters_posters CASCADE;
|
||||
DROP TABLE IF EXISTS chapters_photos CASCADE;
|
||||
|
||||
DROP TABLE IF EXISTS batches CASCADE;
|
||||
|
||||
DROP TABLE IF EXISTS actors_avatars CASCADE;
|
||||
@@ -1042,6 +1122,7 @@ exports.down = (knex) => { // eslint-disable-line arrow-body-style
|
||||
DROP TABLE IF EXISTS tags_posters CASCADE;
|
||||
DROP TABLE IF EXISTS tags_photos CASCADE;
|
||||
DROP TABLE IF EXISTS movies CASCADE;
|
||||
DROP TABLE IF EXISTS chapters CASCADE;
|
||||
DROP TABLE IF EXISTS releases CASCADE;
|
||||
DROP TABLE IF EXISTS actors CASCADE;
|
||||
DROP TABLE IF EXISTS directors CASCADE;
|
||||
|
||||
Reference in New Issue
Block a user