Garrit Franke
3 years ago
7 changed files with 59 additions and 22 deletions
@ -1,8 +1,11 @@ |
|||||||
|
const { knexSnakeCaseMappers } = require('objection'); |
||||||
|
|
||||||
module.exports = { |
module.exports = { |
||||||
client: 'sqlite3', |
client: 'sqlite3', |
||||||
useNullAsDefault: true, |
useNullAsDefault: true, |
||||||
connection: { |
connection: { |
||||||
filename: 'sqlite.db' |
filename: 'sqlite.db' |
||||||
} |
}, |
||||||
|
...knexSnakeCaseMappers(), |
||||||
}; |
}; |
||||||
|
|
||||||
|
@ -0,0 +1,17 @@ |
|||||||
|
exports.up = function(knex) { |
||||||
|
return knex.schema |
||||||
|
.createTable('users', function (table) { |
||||||
|
table.increments('id').primary().notNullable(); |
||||||
|
table.string('email', 255).notNullable(); |
||||||
|
table.string('password_hash').notNullable(); |
||||||
|
table.string('username', 255).notNullable(); |
||||||
|
table.timestamps(true, true); |
||||||
|
|
||||||
|
}) |
||||||
|
}; |
||||||
|
|
||||||
|
exports.down = function(knex) { |
||||||
|
return knex.schema |
||||||
|
.dropTable("users"); |
||||||
|
}; |
||||||
|
|
Loading…
Reference in new issue