Skip to content
This repository was archived by the owner on Feb 4, 2025. It is now read-only.

Commit 125bd22

Browse files
committed
Required uuid pass in
1 parent 3390dc6 commit 125bd22

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

migrations/20200209180112-add-users.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ exports.setup = function(options, seedLink) {
1717
exports.up = function(pgm) {
1818
pgm.createExtension("uuid-ossp")
1919
pgm.createTable("users", {
20-
id: { type: "uuid", primaryKey: true, default: pgm.func('uuid_generate_v4()') },
20+
id: { type: "uuid", primaryKey: true },
2121
name: { type: "string", unique: true, notNull: true },
2222
email: { type: "string", unique: true, notNull: true },
2323
password: { type: "string", notNull: true },

server/database/auth.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ const ret = {
55
return db.query("SELECT * FROM users WHERE id = $1", [id])
66
.then(res => res.rows[0])
77
},
8-
makeUser: ({ name, email, division, password }) => {
9-
return db.query("INSERT INTO users (name, email, division, password) VALUES ($1, $2, $3, $4) RETURNING *",
10-
[name, email, division, password]
8+
makeUser: ({ id, name, email, division, password }) => {
9+
return db.query("INSERT INTO users (id, name, email, division, password) VALUES ($1, $2, $3, $4, $5) RETURNING *",
10+
[id, name, email, division, password]
1111
)
1212
.then(res => res.rows[0])
1313
},

0 commit comments

Comments
 (0)