From 689dbeefbd334409b07a69bc3dcd1129c3a7499d Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Thu, 26 Mar 2020 03:34:37 +0100 Subject: [PATCH] Added database structure for piercings. --- migrations/20190325001339_releases.js | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/migrations/20190325001339_releases.js b/migrations/20190325001339_releases.js index 2f998854..321a332e 100644 --- a/migrations/20190325001339_releases.js +++ b/migrations/20190325001339_releases.js @@ -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;