-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
one statement per migration for sqlite
- Loading branch information
Showing
3 changed files
with
13 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,2 @@ | ||
-- Enable foreign keys in SQLite | ||
PRAGMA foreign_keys = ON; | ||
|
||
-- Create users table | ||
CREATE TABLE IF NOT EXISTS users ( | ||
user_id binary(20) PRIMARY KEY, | ||
private_key binary(32) | ||
); | ||
|
||
-- Create accounts table | ||
CREATE TABLE IF NOT EXISTS accounts ( | ||
user_id binary(20), | ||
account_address binary(20), | ||
signature binary(65), | ||
FOREIGN KEY(user_id) REFERENCES users(user_id) ON DELETE CASCADE | ||
); | ||
PRAGMA foreign_keys = ON; |
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,5 @@ | ||
-- Create users table | ||
CREATE TABLE IF NOT EXISTS users ( | ||
user_id binary(20) PRIMARY KEY, | ||
private_key binary(32) | ||
); |
7 changes: 7 additions & 0 deletions
7
tools/walletextension/storage/database/sqlite/003_accounts.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 accounts table | ||
CREATE TABLE IF NOT EXISTS accounts ( | ||
user_id binary(20), | ||
account_address binary(20), | ||
signature binary(65), | ||
FOREIGN KEY(user_id) REFERENCES users(user_id) ON DELETE CASCADE | ||
); |