mirror of https://github.com/requarks/wiki
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.
24 lines
737 B
24 lines
737 B
5 years ago
|
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')
|
||
|
})
|
||
|
}
|