Skip to content

Commit

Permalink
remove table creation from init and only grant access
Browse files Browse the repository at this point in the history
  • Loading branch information
zkokelj committed Feb 2, 2024
1 parent f64f09c commit 3e9ddc0
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions tools/walletextension/storage/database/001_init.sql
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
);

0 comments on commit 3e9ddc0

Please sign in to comment.