-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: extract migrations into directory (#1035)
- Loading branch information
Showing
11 changed files
with
68 additions
and
60 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
1 change: 1 addition & 0 deletions
1
ee/tabby-webserver/migrations/01-registration-token-table/down.sql
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE registration_token; |
7 changes: 7 additions & 0 deletions
7
ee/tabby-webserver/migrations/01-registration-token-table/up.sql
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
CREATE TABLE registration_token ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
token VARCHAR(255) NOT NULL, | ||
created_at TIMESTAMP DEFAULT (DATETIME('now')), | ||
updated_at TIMESTAMP DEFAULT (DATETIME('now')), | ||
CONSTRAINT `idx_token` UNIQUE (`token`) | ||
); |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE users; |
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
CREATE TABLE users ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
email VARCHAR(150) NOT NULL COLLATE NOCASE, | ||
password_encrypted VARCHAR(128) NOT NULL, | ||
is_admin BOOLEAN NOT NULL DEFAULT 0, | ||
created_at TIMESTAMP DEFAULT (DATETIME('now')), | ||
updated_at TIMESTAMP DEFAULT (DATETIME('now')), | ||
auth_token VARCHAR(128) NOT NULL, | ||
|
||
CONSTRAINT `idx_email` UNIQUE (`email`) | ||
CONSTRAINT `idx_auth_token` UNIQUE (`auth_token`) | ||
); |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE invitations; |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CREATE TABLE invitations ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
email VARCHAR(150) NOT NULL COLLATE NOCASE, | ||
code VARCHAR(36) NOT NULL, | ||
created_at TIMESTAMP DEFAULT (DATETIME('now')), | ||
CONSTRAINT `idx_email` UNIQUE (`email`) | ||
CONSTRAINT `idx_code` UNIQUE (`code`) | ||
); |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
DROP TABLE refresh_tokens; |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
CREATE TABLE refresh_tokens ( | ||
id INTEGER PRIMARY KEY AUTOINCREMENT, | ||
user_id INTEGER NOT NULL, | ||
token VARCHAR(255) NOT NULL COLLATE NOCASE, | ||
expires_at TIMESTAMP NOT NULL, | ||
created_at TIMESTAMP DEFAULT (DATETIME('now')), | ||
CONSTRAINT `idx_token` UNIQUE (`token`) | ||
); |
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