Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed Apr 23, 2024
1 parent 2a7012a commit 2ae0444
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ee/tabby-db/migrations/0026_clean-up-tables.up.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
DROP TABLE github_oauth_credential;
DROP TABLE google_oauth_credential;

-- Drop the entire refresh_token table to resolve the foreign key issue.
-- Drop the entire refresh_token / password_reset table to resolve the foreign key issue.
-- This is acceptable as it is equivalent to asking all users to sign in again for the new release.
DROP TABLE refresh_tokens;
DROP TABLE password_reset;

CREATE TABLE refresh_tokens(
id INTEGER PRIMARY KEY AUTOINCREMENT,
Expand All @@ -13,5 +14,14 @@ CREATE TABLE refresh_tokens(
created_at TIMESTAMP DEFAULT(DATETIME('now')),
CONSTRAINT `idx_token` UNIQUE(`token`)

FOREIGN KEY(user_id) REFERENCES users(id)
);

CREATE TABLE password_reset(
id INTEGER PRIMARY KEY AUTOINCREMENT,
user_id INTEGER NOT NULL UNIQUE,
code VARCHAR(36) NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT(DATETIME('now')),

FOREIGN KEY(user_id) REFERENCES users(id)
);
Binary file modified ee/tabby-db/schema.sqlite
Binary file not shown.

0 comments on commit 2ae0444

Please sign in to comment.