generated from ubiquity/ts-template
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c9762d2
commit eaea55d
Showing
2 changed files
with
8 additions
and
8 deletions.
There are no files selected for viewing
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,14 @@ | ||
CREATE TABLE IF NOT EXISTS users ( | ||
id BIGINT PRIMARY KEY, | ||
username VARCHAR(255) UNIQUE NOT NULL, | ||
created_at DATE DEFAULT CURRENT_TIMESTAMP, | ||
updated_at DATE DEFAULT CURRENT_TIMESTAMP | ||
created_at TIMESTAMP NOT NULL, | ||
updated_at TIMESTAMP NOT NULL | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS wallets ( | ||
wallet_id SERIAL PRIMARY KEY, | ||
user_id BIGINT NOT NULL, | ||
address VARCHAR(255) UNIQUE NOT NULL, | ||
FOREIGN KEY (user_id) REFERENCES users(id) | ||
github_user_id BIGINT NOT NULL, | ||
wallet_address VARCHAR(255) UNIQUE NOT NULL, | ||
FOREIGN KEY (github_user_id) REFERENCES github_users(id) | ||
ON DELETE CASCADE | ||
); |