-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from ZeusWPI/enhance-user-model
Enhance user model
- Loading branch information
Showing
16 changed files
with
331 additions
and
83 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,30 @@ | ||
CREATE TABLE users ( | ||
id SERIAL PRIMARY KEY, | ||
username VARCHAR(255) NOT NULL UNIQUE, | ||
password VARCHAR(255) NOT NULL, | ||
admin BOOLEAN NOT NULL DEFAULT false | ||
CREATE TYPE user_state AS ENUM ('pending', 'active', 'disabled'); | ||
|
||
CREATE TABLE users | ||
( | ||
id SERIAL PRIMARY KEY, | ||
username VARCHAR(255) NOT NULL UNIQUE, | ||
hashed_password VARCHAR(255) NOT NULL, | ||
admin BOOLEAN NOT NULL DEFAULT false, | ||
first_name VARCHAR(255) NOT NULL, | ||
last_name VARCHAR(255) NOT NULL, | ||
email VARCHAR(255) NOT NULL UNIQUE, | ||
ssh_key TEXT, | ||
state user_state NOT NULL DEFAULT 'pending', | ||
last_login TIMESTAMP NOT NULL, | ||
created_at TIMESTAMP NOT NULL DEFAULT NOW() | ||
); | ||
|
||
CREATE TABLE clients ( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR(255) NOT NULL UNIQUE, | ||
secret VARCHAR(255) NOT NULL, | ||
needs_grant BOOLEAN NOT NULL DEFAULT false, | ||
redirect_uri_list TEXT NOT NULL DEFAULT '' | ||
CREATE INDEX ix_users_username ON users (username); | ||
CREATE INDEX ix_users_email ON users (email); | ||
|
||
|
||
CREATE TABLE clients | ||
( | ||
id SERIAL PRIMARY KEY, | ||
name VARCHAR(255) NOT NULL UNIQUE, | ||
secret VARCHAR(255) NOT NULL, | ||
needs_grant BOOLEAN NOT NULL DEFAULT false, | ||
redirect_uri_list TEXT NOT NULL DEFAULT '', | ||
created_at TIMESTAMP NOT NULL DEFAULT NOW() | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.