Skip to content

Commit

Permalink
Fix: attempt to fix github actions to include postgres config
Browse files Browse the repository at this point in the history
Signed-off-by: guacamole <gunjanwalecha@gmail.com>
  • Loading branch information
guacamole committed Dec 14, 2021
1 parent 5c5512a commit b3fb04a
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 35 deletions.
66 changes: 34 additions & 32 deletions scripts/postgres/OpenRegistry.sql
Original file line number Diff line number Diff line change
@@ -1,46 +1,48 @@

CREATE TABLE "users" (
"id" uuid PRIMARY KEY,
"is_active" boolean,
"username" varchar NOT NULL UNIQUE,
"email" varchar NOT NULL UNIQUE,
"password" varchar,
"created_at" timestamp,
"updated_at" timestamp,
"country_code" int
"id" uuid PRIMARY KEY,
"is_active" boolean,
"username" varchar NOT NULL UNIQUE,
"email" varchar NOT NULL UNIQUE,
"password" varchar,
"created_at" timestamp,
"updated_at" timestamp,
"country_code" int
);

CREATE TABLE "config" (
"uuid" uuid UNIQUE NOT NULL,
"namespace" text,
"reference" text,
"digest" text UNIQUE NOT NULL,
"sky_link" text,
"media_type" text,
"layers" text[],
"size" int,
PRIMARY KEY (namespace,reference)
"uuid" uuid UNIQUE NOT NULL,
"namespace" text NOT NULL,
"reference" text NOT NULL,
"digest" text NOT NULL,
"sky_link" text,
"media_type" text,
"layers" text[],
"size" int,
PRIMARY KEY(namespace, reference)
);

CREATE TABLE "blob" (
"uuid" uuid,
"digest" text PRIMARY KEY,
"sky_link" text,
"start_range" int,
"end_range" int
"uuid" uuid,
"digest" text PRIMARY KEY,
"sky_link" text,
"start_range" int,
"end_range" int
);

CREATE TABLE "layer" (
"uuid" uuid PRIMARY KEY,
"digest" text UNIQUE NOT NULL,
"blob_ids" text[],
"media_type" text,
"sky_link" text,
"size" int
"uuid" uuid PRIMARY KEY,
"digest" text UNIQUE NOT NULL,
"blob_ids" text[],
"media_type" text,
"sky_link" text,
"size" int
);

CREATE TABLE "image_manifest" (
"uuid" uuid PRIMARY KEY,
"namespace" text UNIQUE NOT NULL,
"media_type" text,
"schema_version" int
"uuid" uuid PRIMARY KEY,
"namespace" text UNIQUE NOT NULL,
"media_type" text,
"schema_version" int
);

4 changes: 1 addition & 3 deletions scripts/postgres/setup.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/bin/bash

set -e
/Applications/Postgres.app/Contents/Versions/14/bin/psql -v ON_ERROR_STOP=1 --username "$PGUSER" --dbname "$PGDATABASE" <<-EOSQL
CREATE USER jane_doe;
GRANT ALL PRIVILEGES ON DATABASE open_registry TO jane_doe;
psql -v ON_ERROR_STOP=1 --host="0.0.0.0" --port="5432" --username "$PGUSER" --dbname "$PGDATABASE" <<-EOSQL
\c open_registry;
\i scripts/postgres/OpenRegistry.sql
EOSQL

0 comments on commit b3fb04a

Please sign in to comment.