mirror of https://github.com/Requarks/wiki.git
Nick
5 years ago
5 changed files with 102 additions and 40 deletions
Split View
Diff Options
-
6client/themes/default/components/page.vue
-
13server/db/migrations-sqlite/2.0.0-beta.293.js
-
19server/db/migrations/2.0.0-beta.293.js
-
102server/models/pages.js
-
2server/views/page.pug
@ -0,0 +1,13 @@ |
|||
exports.up = knex => { |
|||
return knex.schema |
|||
.createTable('pageLinks', table => { |
|||
table.increments('id').primary() |
|||
table.integer('sourcePageId').unsigned().references('id').inTable('pages').onDelete('CASCADE') |
|||
table.integer('targetPageId').unsigned().references('id').inTable('pages').onDelete('CASCADE') |
|||
}) |
|||
} |
|||
|
|||
exports.down = knex => { |
|||
return knex.schema |
|||
.dropTableIfExists('pageLinks') |
|||
} |
@ -0,0 +1,19 @@ |
|||
/* global WIKI */ |
|||
|
|||
exports.up = knex => { |
|||
const dbCompat = { |
|||
charset: (WIKI.config.db.type === `mysql` || WIKI.config.db.type === `mariadb`) |
|||
} |
|||
return knex.schema |
|||
.createTable('pageLinks', table => { |
|||
if (dbCompat.charset) { table.charset('utf8mb4') } |
|||
table.increments('id').primary() |
|||
table.integer('sourcePageId').unsigned().references('id').inTable('pages').onDelete('CASCADE') |
|||
table.integer('targetPageId').unsigned().references('id').inTable('pages').onDelete('CASCADE') |
|||
}) |
|||
} |
|||
|
|||
exports.down = knex => { |
|||
return knex.schema |
|||
.dropTableIfExists('pageLinks') |
|||
} |
Write
Preview
Loading…
Cancel
Save