Added Experiences and Formations

This commit is contained in:
2021-08-16 22:32:44 +02:00
parent 7a5a246177
commit 98f9402de4
11 changed files with 324 additions and 31 deletions

View File

@@ -0,0 +1,25 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class Experiences extends BaseSchema {
protected tableName = 'experiences'
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table
.increments('title_id')
.unsigned()
.references('translations.id')
.onDelete('CASCADE')
table.string('company').notNullable()
table.string('location').notNullable()
table.string('begin_date').notNullable()
table.string('end_date').defaultTo('Today').notNullable()
table.timestamps(true, true)
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}

View File

@@ -0,0 +1,29 @@
import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class Formations extends BaseSchema {
protected tableName = 'formations'
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table
.integer('title_id')
.unsigned()
.references('translations.id')
.onDelete('CASCADE')
table
.integer('description_id')
.unsigned()
.references('translations.id')
.onDelete('CASCADE')
table.string('location').notNullable()
table.string('begin_date').notNullable()
table.string('end_date').defaultTo('Today').notNullable()
table.timestamps(true, true)
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}