Last active
July 19, 2018 13:51
-
-
Save diego3g/ac2338d19296484b77da6bd6405beb1e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
const Schema = use('Schema') | |
class ImageSchema extends Schema { | |
up () { | |
this.create('images', table => { | |
table.increments() | |
table | |
.integer('property_id') | |
.unsigned() | |
.references('id') | |
.inTable('properties') | |
.onUpdate('CASCADE') | |
.onDelete('CASCADE') | |
table.string('path').notNullable() | |
table.timestamps() | |
}) | |
} | |
down () { | |
this.drop('images') | |
} | |
} | |
module.exports = ImageSchema |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment