mirror of
https://github.com/plankanban/planka.git
synced 2025-07-22 06:39: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() {
|
customToJSON() {
|
||||||
return {
|
return {
|
||||||
..._.omit(this, 'password'),
|
..._.omit(this, 'password'),
|
||||||
|
|
|
@ -23,6 +23,5 @@ module.exports.up = knex =>
|
||||||
module.exports.down = knex =>
|
module.exports.down = knex =>
|
||||||
knex.raw(`
|
knex.raw(`
|
||||||
DROP SEQUENCE next_id_seq;
|
DROP SEQUENCE next_id_seq;
|
||||||
|
|
||||||
DROP FUNCTION next_id(OUT id BIGINT);
|
DROP FUNCTION next_id(OUT id BIGINT);
|
||||||
`);
|
`);
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
module.exports.up = knex =>
|
module.exports.up = knex =>
|
||||||
knex.schema
|
knex.schema
|
||||||
.createTable('user', table => {
|
.createTable('user_account', table => {
|
||||||
/* Columns */
|
/* Columns */
|
||||||
|
|
||||||
table
|
table
|
||||||
|
@ -19,7 +19,7 @@ module.exports.up = knex =>
|
||||||
table.timestamp('deleted_at', true);
|
table.timestamp('deleted_at', true);
|
||||||
})
|
})
|
||||||
.raw(
|
.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 => {
|
exports.seed = knex => {
|
||||||
const date = new Date().toUTCString();
|
const date = new Date().toUTCString();
|
||||||
|
|
||||||
return knex('user').insert({
|
return knex('user_account').insert({
|
||||||
email: 'demo@demo.demo',
|
email: 'demo@demo.demo',
|
||||||
password: bcrypt.hashSync('demo', 10),
|
password: bcrypt.hashSync('demo', 10),
|
||||||
isAdmin: true,
|
isAdmin: true,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue