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

  1. exports.up = knex => {
  2. return knex.schema
  3. .table('pageTree', table => {
  4. table.dropColumn('parent')
  5. table.dropColumn('pageId')
  6. })
  7. .table('pageTree', table => {
  8. table.integer('parent').unsigned().references('id').inTable('pageTree').onDelete('CASCADE')
  9. table.integer('pageId').unsigned().references('id').inTable('pages').onDelete('CASCADE')
  10. })
  11. }
  12. exports.down = knex => {
  13. return knex.schema
  14. .table('pageTree', table => {
  15. table.dropColumn('parent')
  16. table.dropColumn('pageId')
  17. })
  18. .table('pageTree', table => {
  19. table.integer('parent').unsigned().references('id').inTable('pageTree')
  20. table.integer('pageId').unsigned().references('id').inTable('pages')
  21. })
  22. }