Model controllers added
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { BaseSchema } from '@adonisjs/lucid/schema'
|
||||
|
||||
export default class extends BaseSchema {
|
||||
protected tableName = 'restaurant_menu_items'
|
||||
|
||||
async up() {
|
||||
this.schema.createTable(this.tableName, (table) => {
|
||||
table.increments('id').primary()
|
||||
table.integer('restaurant_menu_id').unsigned().references('restaurant_menus.id')
|
||||
table.string('name').notNullable()
|
||||
table.integer('price_small').notNullable()
|
||||
table.integer('price_large').notNullable()
|
||||
table.string('description').nullable()
|
||||
|
||||
table.timestamp('created_at')
|
||||
table.timestamp('updated_at')
|
||||
})
|
||||
}
|
||||
|
||||
async down() {
|
||||
this.schema.dropTable(this.tableName)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user