generated from pure_sagacity/rust-starter
added database stuff
added clap arguments added the gen_or_get_key func in lib git ignore for .env migrations
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DROP TABLE IF EXISTS secrets;
|
||||
DROP TABLE IF EXISTS projects;
|
||||
@@ -0,0 +1,19 @@
|
||||
CREATE TABLE projects (
|
||||
id TEXT PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
);
|
||||
|
||||
CREATE TABLE secrets (
|
||||
id TEXT PRIMARY KEY,
|
||||
name TEXT NOT NULL,
|
||||
project_id TEXT NOT NULL,
|
||||
config TEXT NOT NULL,
|
||||
secret BLOB NOT NULL,
|
||||
nonce BLOB NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE,
|
||||
|
||||
UNIQUE (project_id, config, name)
|
||||
);
|
||||
Reference in New Issue
Block a user