Added database structure for piercings.

This commit is contained in:
ThePendulum 2020-03-26 03:34:37 +01:00
parent d29e296799
commit 689dbeefbd
1 changed files with 24 additions and 1 deletions

View File

@ -357,7 +357,7 @@ exports.up = knex => Promise.resolve()
// arms
{ slug: 'arm', name: 'arm' },
{ slug: 'upper-arm', name: 'upper arm' },
{ slug: 'lower-arm', name: 'lower arm' },
{ slug: 'forearm', name: 'forearm' },
{ slug: 'elbow', name: 'elbow' },
{ slug: 'inner-elbow', name: 'inner elbow' },
{ slug: 'outer-elbow', name: 'outer elbow' },
@ -408,7 +408,10 @@ exports.up = knex => Promise.resolve()
{ slug: 'leg', name: 'leg' },
{ slug: 'groin', name: 'groin' },
{ slug: 'upper-leg', name: 'upper leg' },
{ slug: 'thigh', name: 'thigh' },
{ slug: 'lower-leg', name: 'lower leg' },
{ slug: 'shin', name: 'shin' },
{ slug: 'calf', name: 'calf' },
{ slug: 'knee', name: 'knee' },
{ slug: 'inner-knee', name: 'inner knee' },
// feet
@ -441,6 +444,25 @@ exports.up = knex => Promise.resolve()
table.datetime('created_at')
.defaultTo(knex.fn.now());
}))
.then(() => knex.schema.createTable('actors_piercings', (table) => {
table.increments('id');
table.integer('actor_id', 12)
.notNullable()
.references('id')
.inTable('actors');
table.string('body_slug', 20)
.references('slug')
.inTable('body');
table.enum('side', ['left', 'right', 'center', 'both']);
table.string('description');
table.datetime('created_at')
.defaultTo(knex.fn.now());
}))
.then(() => knex.schema.createTable('actors_avatars', (table) => {
table.integer('actor_id', 12)
.notNullable()
@ -752,6 +774,7 @@ exports.down = knex => knex.raw(`
DROP TABLE IF EXISTS actors_social CASCADE;
DROP TABLE IF EXISTS actors_profiles CASCADE;
DROP TABLE IF EXISTS actors_tattoos CASCADE;
DROP TABLE IF EXISTS actors_piercings CASCADE;
DROP TABLE IF EXISTS body CASCADE;
DROP TABLE IF EXISTS sites_tags CASCADE;