Skip to content

Commit

Permalink
Improve docker-compose example to bypass setup command (close #33)
Browse files Browse the repository at this point in the history
  • Loading branch information
oguzhanunlu committed Nov 1, 2019
1 parent c88e6dc commit d38f02e
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions docker/init.sql
Original file line number Diff line number Diff line change
@@ -1,2 +1,39 @@
ALTER USER postgres WITH PASSWORD 'iglusecret';
CREATE DATABASE igludb OWNER postgres;
\connect igludb;
CREATE TYPE key_action AS ENUM ('CREATE', 'DELETE');
CREATE TYPE schema_action AS ENUM ('READ', 'BUMP', 'CREATE', 'CREATE_VENDOR');
CREATE TABLE iglu_permissions (
apikey UUID NOT NULL,
vendor VARCHAR(128),
wildcard BOOL NOT NULL,
schema_action schema_action,
key_action key_action[] NOT NULL,
PRIMARY KEY (apikey)
);
CREATE TABLE iglu_schemas (
vendor VARCHAR(128) NOT NULL,
name VARCHAR(128) NOT NULL,
format VARCHAR(128) NOT NULL,
model INTEGER NOT NULL,
revision INTEGER NOT NULL,
addition INTEGER NOT NULL,

created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
is_public BOOLEAN NOT NULL,

body JSON NOT NULL
);
CREATE TABLE iglu_drafts (
vendor VARCHAR(128) NOT NULL,
name VARCHAR(128) NOT NULL,
format VARCHAR(128) NOT NULL,
version INTEGER NOT NULL,

created_at TIMESTAMP NOT NULL,
updated_at TIMESTAMP NOT NULL,
is_public BOOLEAN NOT NULL,

body JSON NOT NULL
);

0 comments on commit d38f02e

Please sign in to comment.