-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove table creation from init and only grant access
- Loading branch information
Showing
1 changed file
with
1 addition
and
16 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,22 +1,7 @@ | ||
/* | ||
This file is used to initialize the database by the github action manual-deploy-obscuro-gateway-database.yml | ||
todo (@ziga) : separate the database initialization from the database migration and delete this file and use migration files for each database type instead (sqlite, mariadb, edgelessdb) | ||
This file is used to create database and create the necessary permissions to the user that will be used by the gateway. | ||
*/ | ||
|
||
CREATE DATABASE ogdb; | ||
|
||
USE ogdb; | ||
|
||
GRANT SELECT, INSERT, UPDATE, DELETE ON ogdb.* TO 'obscurouser'; | ||
|
||
CREATE TABLE IF NOT EXISTS ogdb.users ( | ||
user_id varbinary(20) PRIMARY KEY, | ||
private_key varbinary(32) | ||
); | ||
CREATE TABLE IF NOT EXISTS ogdb.accounts ( | ||
user_id varbinary(20), | ||
account_address varbinary(20), | ||
signature varbinary(65), | ||
FOREIGN KEY(user_id) REFERENCES users(user_id) ON DELETE CASCADE | ||
); |