diff --git a/tools/walletextension/storage/database/sqlite/001_init.sql b/tools/walletextension/storage/database/sqlite/001_init.sql index eb2bcbcbc9..a0456ea7f5 100644 --- a/tools/walletextension/storage/database/sqlite/001_init.sql +++ b/tools/walletextension/storage/database/sqlite/001_init.sql @@ -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 - ); \ No newline at end of file +PRAGMA foreign_keys = ON; \ No newline at end of file diff --git a/tools/walletextension/storage/database/sqlite/002_users.sql b/tools/walletextension/storage/database/sqlite/002_users.sql new file mode 100644 index 0000000000..7155d722f0 --- /dev/null +++ b/tools/walletextension/storage/database/sqlite/002_users.sql @@ -0,0 +1,5 @@ +-- Create users table +CREATE TABLE IF NOT EXISTS users ( + user_id binary(20) PRIMARY KEY, + private_key binary(32) +); \ No newline at end of file diff --git a/tools/walletextension/storage/database/sqlite/003_accounts.sql b/tools/walletextension/storage/database/sqlite/003_accounts.sql new file mode 100644 index 0000000000..6099ad5017 --- /dev/null +++ b/tools/walletextension/storage/database/sqlite/003_accounts.sql @@ -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 +); \ No newline at end of file