Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .hasura/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
admin_secret: hasura
endpoint: http://localhost:8080
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: DROP TABLE "public"."organizations"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- args:
sql: CREATE TABLE "public"."organizations"("login" text NOT NULL, PRIMARY KEY
("login") );
type: run_sql
- args:
name: organizations
schema: public
type: add_existing_table_or_view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: DROP TABLE "public"."members"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
- args:
sql: CREATE TABLE "public"."members"("organization_login" text NOT NULL, "login"
text NOT NULL, "member_since" timestamptz NOT NULL DEFAULT now(), PRIMARY KEY
("login") , FOREIGN KEY ("organization_login") REFERENCES "public"."organizations"("login")
ON UPDATE cascade ON DELETE restrict);
type: run_sql
- args:
name: members
schema: public
type: add_existing_table_or_view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."members" DROP COLUMN "name";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."members" ADD COLUMN "name" text NULL;
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: DROP TABLE "public"."repositories"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: CREATE TABLE "public"."repositories"("name" text NOT NULL, "url" text NOT
NULL, "discovered_at" timestamptz NOT NULL DEFAULT now(), "owner_login" text
NOT NULL, "id" uuid NOT NULL DEFAULT gen_random_uuid(), "name_with_owner" text
NOT NULL, "primary_language_id" text, PRIMARY KEY ("id") , UNIQUE ("name_with_owner",
"discovered_at"));
type: run_sql
- args:
name: repositories
schema: public
type: add_existing_table_or_view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."repositories" DROP COLUMN "last_seen_at";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- args:
sql: ALTER TABLE "public"."repositories" ADD COLUMN "last_seen_at" timestamptz
NOT NULL;
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: DROP TABLE "public"."programming_language"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- args:
sql: CREATE TABLE "public"."programming_language"("id" text NOT NULL, "name" text
NOT NULL, PRIMARY KEY ("id") );
type: run_sql
- args:
name: programming_language
schema: public
type: add_existing_table_or_view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- args:
sql: "\n alter table \"public\".\"repositories\" drop constraint \"repositories_primary_language_id_fkey\"\n
\ "
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
sql: "\n alter table \"public\".\"repositories\"\n add constraint
\"repositories_primary_language_id_fkey\" \n foreign key (\"primary_language_id\")
\n references \"public\".\"programming_language\"\n (\"id\")
on update cascade on delete set null;\n "
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
relationship: members
table:
name: organizations
schema: public
type: drop_relationship
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- args:
name: members
table:
name: organizations
schema: public
using:
foreign_key_constraint_on:
column: organization_login
table:
name: members
schema: public
type: create_array_relationship
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."members" DROP COLUMN "last_seen_at";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- args:
sql: ALTER TABLE "public"."members" ADD COLUMN "last_seen_at" timestamptz NOT
NULL;
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
sql: alter table "public"."repositories" drop constraint "repositories_pkey";
type: run_sql
- sql: "alter table \"public\".\"repositories\"\n add constraint \"repositories_pkey\"
\n primary key ( \"id\" );"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- args:
sql: alter table "public"."repositories" drop constraint "repositories_pkey";
type: run_sql
- args:
sql: "alter table \"public\".\"repositories\"\n add constraint \"repositories_pkey\"
\n primary key ( \"name_with_owner\" );"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- args:
sql: ALTER TABLE "public"."repositories" ADD COLUMN "id" uuid
type: run_sql
- args:
sql: ALTER TABLE "public"."repositories" ALTER COLUMN "id" DROP NOT NULL
type: run_sql
- args:
sql: ALTER TABLE "public"."repositories" ALTER COLUMN "id" SET DEFAULT gen_random_uuid()
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."repositories" DROP COLUMN "id" CASCADE
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."repositories" DROP COLUMN "stars";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."repositories" ADD COLUMN "stars" integer NOT NULL;
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: DROP TABLE "public"."owners"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- args:
sql: CREATE TABLE "public"."owners"("login" text NOT NULL, PRIMARY KEY ("login")
);
type: run_sql
- args:
name: owners
schema: public
type: add_existing_table_or_view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- args:
sql: "\n alter table \"public\".\"organizations\" drop constraint \"organizations_login_fkey\"\n
\ "
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
sql: "\n alter table \"public\".\"organizations\"\n add constraint
\"organizations_login_fkey\" \n foreign key (\"login\") \n references
\"public\".\"owners\"\n (\"login\") on update cascade on delete cascade;\n
\ "
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- args:
sql: "\n alter table \"public\".\"members\" drop constraint \"members_login_fkey\"\n
\ "
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
sql: "\n alter table \"public\".\"members\"\n add constraint
\"members_login_fkey\" \n foreign key (\"login\") \n references
\"public\".\"owners\"\n (\"login\") on update cascade on delete cascade;\n
\ "
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: DROP TABLE "public"."contributors"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: CREATE TABLE "public"."contributors"("login" text NOT NULL, "repository_id"
text NOT NULL, "contribution_count" integer NOT NULL, "observed_at" timestamptz
NOT NULL DEFAULT now(), "id" uuid NOT NULL DEFAULT gen_random_uuid(), PRIMARY
KEY ("id") );
type: run_sql
- args:
name: contributors
schema: public
type: add_existing_table_or_view
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."repositories" DROP COLUMN "id";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."repositories" ADD COLUMN "id" text NOT NULL;
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
sql: alter table "public"."repositories" drop constraint "repositories_pkey";
type: run_sql
- sql: "alter table \"public\".\"repositories\"\n add constraint \"repositories_pkey\"
\n primary key ( \"name_with_owner\" );"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- args:
sql: alter table "public"."repositories" drop constraint "repositories_pkey";
type: run_sql
- args:
sql: "alter table \"public\".\"repositories\"\n add constraint \"repositories_pkey\"
\n primary key ( \"id\" );"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- sql: "alter table \"public\".\"repositories\"\n add constraint \"repositories_pkey\"
\n primary key ( \"id\" );"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: alter table "public"."repositories" drop constraint "repositories_pkey";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
sql: ALTER TABLE "public"."repositories" ADD COLUMN "id" text
type: run_sql
- args:
sql: ALTER TABLE "public"."repositories" ALTER COLUMN "id" DROP NOT NULL
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."repositories" DROP COLUMN "id" CASCADE
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."repositories" DROP COLUMN "id";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: ALTER TABLE "public"."repositories" ADD COLUMN "id" uuid NOT NULL DEFAULT
gen_random_uuid();
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- args:
sql: ALTER TABLE "public"."repositories" ADD COLUMN "last_seen_at" timestamptz
type: run_sql
- args:
sql: ALTER TABLE "public"."repositories" ALTER COLUMN "last_seen_at" DROP NOT
NULL
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."repositories" DROP COLUMN "last_seen_at" CASCADE
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."organizations" DROP COLUMN "id";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- args:
sql: CREATE EXTENSION IF NOT EXISTS pgcrypto;
type: run_sql
- args:
sql: ALTER TABLE "public"."organizations" ADD COLUMN "id" uuid NOT NULL DEFAULT
gen_random_uuid();
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."organizations" DROP COLUMN "fetched_at";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- args:
sql: ALTER TABLE "public"."organizations" ADD COLUMN "fetched_at" timestamptz
NOT NULL DEFAULT now();
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
sql: ALTER TABLE "public"."members" ADD COLUMN "last_seen_at" timestamptz
type: run_sql
- args:
sql: ALTER TABLE "public"."members" ALTER COLUMN "last_seen_at" DROP NOT NULL
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."members" DROP COLUMN "last_seen_at" CASCADE
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- args:
sql: ALTER TABLE "public"."members" ADD COLUMN "member_since" timestamptz
type: run_sql
- args:
sql: ALTER TABLE "public"."members" ALTER COLUMN "member_since" DROP NOT NULL
type: run_sql
- args:
sql: ALTER TABLE "public"."members" ALTER COLUMN "member_since" SET DEFAULT now()
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."members" DROP COLUMN "member_since" CASCADE
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- args:
name: members
table:
name: organizations
schema: public
using:
foreign_key_constraint_on:
column: organization_login
table:
name: members
schema: public
type: create_array_relationship
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
relationship: members
table:
name: organizations
schema: public
type: drop_relationship
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
- args:
sql: ALTER TABLE "public"."members" ADD COLUMN "organization_login" text
type: run_sql
- args:
sql: ALTER TABLE "public"."members" ALTER COLUMN "organization_login" DROP NOT
NULL
type: run_sql
- args:
sql: ALTER TABLE "public"."members" ADD CONSTRAINT members_organization_login_fkey
FOREIGN KEY (organization_login) REFERENCES "public"."organizations" (login)
ON DELETE restrict ON UPDATE cascade
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."members" DROP COLUMN "organization_login" CASCADE
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."members" DROP COLUMN "organization_id";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: ALTER TABLE "public"."members" ADD COLUMN "organization_id" uuid NOT NULL;
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- args:
sql: alter table "public"."members" add foreign key ("login") references "public"."owners"("login")
on update cascade on delete cascade;
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- args:
sql: alter table "public"."members" drop constraint "members_login_fkey";
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
- args:
sql: alter table "public"."organizations" drop constraint "organizations_pkey";
type: run_sql
- sql: "alter table \"public\".\"organizations\"\n add constraint \"organizations_pkey\"
\n primary key ( \"login\" );"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
- args:
sql: alter table "public"."organizations" drop constraint "organizations_pkey";
type: run_sql
- args:
sql: "alter table \"public\".\"organizations\"\n add constraint \"organizations_pkey\"
\n primary key ( \"id\" );"
type: run_sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- args:
sql: "\n alter table \"public\".\"members\" drop constraint \"members_organization_id_fkey\"\n
\ "
type: run_sql
Loading