2024-10-19 23:59:18 +00:00
|
|
|
exports.up = async (knex) => {
|
2024-10-21 03:41:04 +00:00
|
|
|
await knex.raw('CREATE UNIQUE INDEX unique_main_profiles ON actors_profiles (actor_id) WHERE (entity_id IS NULL);');
|
|
|
|
|
2024-10-19 23:59:18 +00:00
|
|
|
await knex.schema.createTable('actors_revisions', (table) => {
|
|
|
|
table.increments('id');
|
|
|
|
|
|
|
|
table.integer('actor_id')
|
|
|
|
.references('id')
|
|
|
|
.inTable('actors')
|
|
|
|
.onDelete('set null');
|
|
|
|
|
|
|
|
table.integer('profile_id')
|
|
|
|
.references('id')
|
|
|
|
.inTable('actors_profiles')
|
|
|
|
.onDelete('set null');
|
|
|
|
|
|
|
|
table.integer('user_id')
|
|
|
|
.references('id')
|
|
|
|
.inTable('users')
|
|
|
|
.onDelete('set null');
|
|
|
|
|
|
|
|
table.json('base')
|
|
|
|
.notNullable();
|
|
|
|
|
|
|
|
table.json('deltas')
|
|
|
|
.notNullable();
|
|
|
|
|
|
|
|
table.text('hash')
|
|
|
|
.notNullable();
|
|
|
|
|
|
|
|
table.text('comment');
|
|
|
|
|
|
|
|
table.boolean('approved');
|
|
|
|
|
|
|
|
table.integer('reviewed_by')
|
|
|
|
.references('id')
|
|
|
|
.inTable('users')
|
|
|
|
.onDelete('set null');
|
|
|
|
|
|
|
|
table.datetime('reviewed_at');
|
|
|
|
table.text('feedback');
|
|
|
|
|
|
|
|
table.datetime('applied_at');
|
|
|
|
|
|
|
|
table.datetime('created_at')
|
|
|
|
.notNullable()
|
|
|
|
.defaultTo(knex.fn.now());
|
|
|
|
});
|
|
|
|
|
|
|
|
await knex.schema.alterTable('actors', (table) => {
|
|
|
|
table.integer('boobs_volume');
|
2024-10-21 03:41:04 +00:00
|
|
|
table.enum('boobs_implant', ['saline', 'silicone', 'gummy', 'fat']);
|
|
|
|
table.enum('boobs_placement', ['over', 'under']);
|
|
|
|
table.string('boobs_surgeon');
|
|
|
|
|
2024-10-22 00:51:00 +00:00
|
|
|
table.boolean('natural_butt');
|
2024-10-19 23:59:18 +00:00
|
|
|
table.integer('butt_volume');
|
2024-10-21 03:41:04 +00:00
|
|
|
table.enum('butt_implant', ['bbl', 'lift', 'silicone', 'lipo', 'filler', 'mms']);
|
|
|
|
|
2024-10-22 00:51:00 +00:00
|
|
|
table.boolean('natural_lips');
|
2024-10-19 23:59:18 +00:00
|
|
|
table.integer('lips_volume');
|
|
|
|
});
|
|
|
|
|
|
|
|
await knex.schema.alterTable('actors_profiles', (table) => {
|
|
|
|
table.integer('boobs_volume');
|
2024-10-21 03:41:04 +00:00
|
|
|
table.enum('boobs_implant', ['saline', 'silicone', 'gummy', 'fat']);
|
|
|
|
table.enum('boobs_placement', ['over', 'under']);
|
|
|
|
table.string('boobs_surgeon');
|
|
|
|
|
2024-10-22 00:51:00 +00:00
|
|
|
table.boolean('natural_butt');
|
2024-10-19 23:59:18 +00:00
|
|
|
table.integer('butt_volume');
|
2024-10-21 03:41:04 +00:00
|
|
|
table.enum('butt_implant', ['bbl', 'lift', 'silicone', 'lipo', 'filler', 'mms']);
|
|
|
|
|
2024-10-22 00:51:00 +00:00
|
|
|
table.boolean('natural_lips');
|
2024-10-19 23:59:18 +00:00
|
|
|
table.integer('lips_volume');
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
exports.down = async (knex) => {
|
2024-10-21 03:41:04 +00:00
|
|
|
await knex.raw('DROP INDEX unique_main_profiles;');
|
|
|
|
|
2024-10-19 23:59:18 +00:00
|
|
|
await knex.schema.dropTable('actors_revisions');
|
|
|
|
|
|
|
|
await knex.schema.alterTable('actors', (table) => {
|
|
|
|
table.dropColumn('boobs_volume');
|
2024-10-21 03:41:04 +00:00
|
|
|
table.dropColumn('boobs_implant');
|
|
|
|
table.dropColumn('boobs_placement');
|
|
|
|
table.dropColumn('boobs_surgeon');
|
|
|
|
|
2024-10-22 00:51:00 +00:00
|
|
|
table.dropColumn('natural_butt');
|
2024-10-19 23:59:18 +00:00
|
|
|
table.dropColumn('butt_volume');
|
2024-10-21 03:41:04 +00:00
|
|
|
table.dropColumn('butt_implant');
|
|
|
|
|
2024-10-22 00:51:00 +00:00
|
|
|
table.dropColumn('natural_lips');
|
2024-10-19 23:59:18 +00:00
|
|
|
table.dropColumn('lips_volume');
|
|
|
|
});
|
|
|
|
|
|
|
|
await knex.schema.alterTable('actors_profiles', (table) => {
|
|
|
|
table.dropColumn('boobs_volume');
|
2024-10-21 03:41:04 +00:00
|
|
|
table.dropColumn('boobs_implant');
|
|
|
|
table.dropColumn('boobs_placement');
|
|
|
|
table.dropColumn('boobs_surgeon');
|
|
|
|
|
2024-10-22 00:51:00 +00:00
|
|
|
table.dropColumn('natural_butt');
|
2024-10-19 23:59:18 +00:00
|
|
|
table.dropColumn('butt_volume');
|
2024-10-21 03:41:04 +00:00
|
|
|
table.dropColumn('butt_implant');
|
|
|
|
|
2024-10-22 00:51:00 +00:00
|
|
|
table.dropColumn('natural_lips');
|
2024-10-19 23:59:18 +00:00
|
|
|
table.dropColumn('lips_volume');
|
|
|
|
});
|
|
|
|
};
|