1
0
Fork 0
mirror of https://github.com/plankanban/planka.git synced 2025-07-19 13:19:44 +02:00

Rename user table, remove ES6 import. Closes #6, closes #7

This commit is contained in:
Maksim Eltyshev 2020-02-25 01:31:52 +05:00
parent 9c7c96a780
commit 5083e7ad57
4 changed files with 7 additions and 6 deletions

View file

@ -64,6 +64,8 @@ module.exports = {
},
},
tableName: 'user_account',
customToJSON() {
return {
..._.omit(this, 'password'),

View file

@ -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);
`);

View file

@ -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');

View file

@ -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,