You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
737 B

exports.up = knex => {
return knex.schema
.table('pageTree', table => {
table.dropColumn('parent')
table.dropColumn('pageId')
})
.table('pageTree', table => {
table.integer('parent').unsigned().references('id').inTable('pageTree').onDelete('CASCADE')
table.integer('pageId').unsigned().references('id').inTable('pages').onDelete('CASCADE')
})
}
exports.down = knex => {
return knex.schema
.table('pageTree', table => {
table.dropColumn('parent')
table.dropColumn('pageId')
})
.table('pageTree', table => {
table.integer('parent').unsigned().references('id').inTable('pageTree')
table.integer('pageId').unsigned().references('id').inTable('pages')
})
}