Files
artdanj-api/database/migrations/1608409476823_locations.ts

20 lines
502 B
TypeScript

import BaseSchema from '@ioc:Adonis/Lucid/Schema'
export default class Locations extends BaseSchema {
protected tableName = 'locations'
public async up () {
this.schema.createTable(this.tableName, (table) => {
table.increments('id').primary()
table.string('place').notNullable()
table.string('left').notNullable()
table.date('since').notNullable()
table.timestamps(true, true)
})
}
public async down () {
this.schema.dropTable(this.tableName)
}
}