mirror of
https://github.com/plankanban/planka.git
synced 2025-07-19 13:19:44 +02:00
parent
9c7c96a780
commit
5083e7ad57
4 changed files with 7 additions and 6 deletions
|
@ -64,6 +64,8 @@ module.exports = {
|
|||
},
|
||||
},
|
||||
|
||||
tableName: 'user_account',
|
||||
|
||||
customToJSON() {
|
||||
return {
|
||||
..._.omit(this, 'password'),
|
||||
|
|
|
@ -23,6 +23,5 @@ module.exports.up = knex =>
|
|||
module.exports.down = knex =>
|
||||
knex.raw(`
|
||||
DROP SEQUENCE next_id_seq;
|
||||
|
||||
DROP FUNCTION next_id(OUT id BIGINT);
|
||||
`);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
module.exports.up = knex =>
|
||||
knex.schema
|
||||
.createTable('user', table => {
|
||||
.createTable('user_account', table => {
|
||||
/* Columns */
|
||||
|
||||
table
|
||||
|
@ -19,7 +19,7 @@ module.exports.up = knex =>
|
|||
table.timestamp('deleted_at', true);
|
||||
})
|
||||
.raw(
|
||||
'ALTER TABLE "user" ADD CONSTRAINT "user_email_unique" EXCLUDE ("email" WITH =) WHERE ("deleted_at" IS NULL)',
|
||||
'ALTER TABLE "user_account" ADD CONSTRAINT "user_email_unique" EXCLUDE ("email" WITH =) WHERE ("deleted_at" IS NULL)',
|
||||
);
|
||||
|
||||
module.exports.down = knex => knex.schema.dropTable('user');
|
||||
module.exports.down = knex => knex.schema.dropTable('user_account');
|
|
@ -1,9 +1,9 @@
|
|||
import bcrypt from 'bcrypt';
|
||||
const bcrypt = require('bcrypt');
|
||||
|
||||
exports.seed = knex => {
|
||||
const date = new Date().toUTCString();
|
||||
|
||||
return knex('user').insert({
|
||||
return knex('user_account').insert({
|
||||
email: 'demo@demo.demo',
|
||||
password: bcrypt.hashSync('demo', 10),
|
||||
isAdmin: true,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue