54cd9491c6
* V3-664 Extend User repository. Reimplemented with dbx * structure updated * redundant packages removed, structure simplified * fixing goimports * removed constuctor from user struct * separated types declarations from database file * test file renamed * fixes according to review * fixing goimports * fixing goimports
18 lines
415 B
SQL
18 lines
415 B
SQL
-- AUTOGENERATED BY gopkg.in/spacemonkeygo/dbx.v1
|
|
-- DO NOT EDIT
|
|
CREATE TABLE users (
|
|
id TEXT NOT NULL,
|
|
first_name TEXT NOT NULL,
|
|
last_name TEXT NOT NULL,
|
|
email TEXT NOT NULL,
|
|
password_hash BLOB NOT NULL,
|
|
created_at TIMESTAMP NOT NULL,
|
|
PRIMARY KEY ( id ),
|
|
UNIQUE ( email )
|
|
);
|
|
CREATE TABLE companies (
|
|
id BLOB NOT NULL,
|
|
userId TEXT NOT NULL REFERENCES users( id ) ON DELETE CASCADE,
|
|
PRIMARY KEY ( id )
|
|
);
|