Fix
This commit is contained in:
@ -1 +0,0 @@
|
|||||||
DROP TABLE "public"."workspace_members";
|
|
||||||
@ -1 +0,0 @@
|
|||||||
CREATE TABLE "public"."workspace_members" ("id" serial NOT NULL, "user_id" uuid NOT NULL, "workspace_id" integer NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("user_id") REFERENCES "auth"."users"("id") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("workspace_id") REFERENCES "public"."workspaces"("id") ON UPDATE restrict ON DELETE restrict, UNIQUE ("id"), UNIQUE ("user_id"));
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
-- Could not auto-generate a down migration.
|
|
||||||
-- Please write an appropriate down migration for the SQL below:
|
|
||||||
-- alter table "public"."workspace_members" add column "created_at" timestamptz
|
|
||||||
-- not null default now();
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
alter table "public"."workspace_members" add column "created_at" timestamptz
|
|
||||||
not null default now();
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
-- Could not auto-generate a down migration.
|
|
||||||
-- Please write an appropriate down migration for the SQL below:
|
|
||||||
-- alter table "public"."workspace_members" add column "updated_at" timestamptz
|
|
||||||
-- not null default now();
|
|
||||||
--
|
|
||||||
-- CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
|
||||||
-- RETURNS TRIGGER AS $$
|
|
||||||
-- DECLARE
|
|
||||||
-- _new record;
|
|
||||||
-- BEGIN
|
|
||||||
-- _new := NEW;
|
|
||||||
-- _new."updated_at" = NOW();
|
|
||||||
-- RETURN _new;
|
|
||||||
-- END;
|
|
||||||
-- $$ LANGUAGE plpgsql;
|
|
||||||
-- CREATE TRIGGER "set_public_workspace_members_updated_at"
|
|
||||||
-- BEFORE UPDATE ON "public"."workspace_members"
|
|
||||||
-- FOR EACH ROW
|
|
||||||
-- EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
|
||||||
-- COMMENT ON TRIGGER "set_public_workspace_members_updated_at" ON "public"."workspace_members"
|
|
||||||
-- IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
alter table "public"."workspace_members" add column "updated_at" timestamptz
|
|
||||||
not null default now();
|
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
|
||||||
RETURNS TRIGGER AS $$
|
|
||||||
DECLARE
|
|
||||||
_new record;
|
|
||||||
BEGIN
|
|
||||||
_new := NEW;
|
|
||||||
_new."updated_at" = NOW();
|
|
||||||
RETURN _new;
|
|
||||||
END;
|
|
||||||
$$ LANGUAGE plpgsql;
|
|
||||||
CREATE TRIGGER "set_public_workspace_members_updated_at"
|
|
||||||
BEFORE UPDATE ON "public"."workspace_members"
|
|
||||||
FOR EACH ROW
|
|
||||||
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
|
||||||
COMMENT ON TRIGGER "set_public_workspace_members_updated_at" ON "public"."workspace_members"
|
|
||||||
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
-- Could not auto-generate a down migration.
|
|
||||||
-- Please write an appropriate down migration for the SQL below:
|
|
||||||
-- alter table "public"."workspace_members" add column "deleted_at" timestamptz
|
|
||||||
-- null;
|
|
||||||
--
|
|
||||||
-- CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_deleted_at"()
|
|
||||||
-- RETURNS TRIGGER AS $$
|
|
||||||
-- DECLARE
|
|
||||||
-- _new record;
|
|
||||||
-- BEGIN
|
|
||||||
-- _new := NEW;
|
|
||||||
-- _new."deleted_at" = NOW();
|
|
||||||
-- RETURN _new;
|
|
||||||
-- END;
|
|
||||||
-- $$ LANGUAGE plpgsql;
|
|
||||||
-- CREATE TRIGGER "set_public_workspace_members_deleted_at"
|
|
||||||
-- BEFORE UPDATE ON "public"."workspace_members"
|
|
||||||
-- FOR EACH ROW
|
|
||||||
-- EXECUTE PROCEDURE "public"."set_current_timestamp_deleted_at"();
|
|
||||||
-- COMMENT ON TRIGGER "set_public_workspace_members_deleted_at" ON "public"."workspace_members"
|
|
||||||
-- IS 'trigger to set value of column "deleted_at" to current timestamp on row update';
|
|
||||||
@ -1,19 +0,0 @@
|
|||||||
alter table "public"."workspace_members" add column "deleted_at" timestamptz
|
|
||||||
null;
|
|
||||||
|
|
||||||
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_deleted_at"()
|
|
||||||
RETURNS TRIGGER AS $$
|
|
||||||
DECLARE
|
|
||||||
_new record;
|
|
||||||
BEGIN
|
|
||||||
_new := NEW;
|
|
||||||
_new."deleted_at" = NOW();
|
|
||||||
RETURN _new;
|
|
||||||
END;
|
|
||||||
$$ LANGUAGE plpgsql;
|
|
||||||
CREATE TRIGGER "set_public_workspace_members_deleted_at"
|
|
||||||
BEFORE UPDATE ON "public"."workspace_members"
|
|
||||||
FOR EACH ROW
|
|
||||||
EXECUTE PROCEDURE "public"."set_current_timestamp_deleted_at"();
|
|
||||||
COMMENT ON TRIGGER "set_public_workspace_members_deleted_at" ON "public"."workspace_members"
|
|
||||||
IS 'trigger to set value of column "deleted_at" to current timestamp on row update';
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
-- Could not auto-generate a down migration.
|
|
||||||
-- Please write an appropriate down migration for the SQL below:
|
|
||||||
-- alter table "public"."workspaces" add column "domain_name" text
|
|
||||||
-- null unique;
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
alter table "public"."workspaces" add column "domain_name" text
|
|
||||||
null unique;
|
|
||||||
@ -1 +0,0 @@
|
|||||||
alter table "public"."workspaces" drop column "domain_name" cascade;
|
|
||||||
@ -1 +0,0 @@
|
|||||||
alter table "public"."workspaces" rename column "domain_name" to "name";
|
|
||||||
@ -1 +0,0 @@
|
|||||||
alter table "public"."workspaces" rename column "name" to "domain_name";
|
|
||||||
@ -1,4 +0,0 @@
|
|||||||
-- Could not auto-generate a down migration.
|
|
||||||
-- Please write an appropriate down migration for the SQL below:
|
|
||||||
-- alter table "public"."workspaces" add column "deleted_at" Timestamp
|
|
||||||
-- null;
|
|
||||||
@ -1,2 +0,0 @@
|
|||||||
alter table "public"."workspaces" add column "deleted_at" Timestamp
|
|
||||||
null;
|
|
||||||
@ -1,3 +1,10 @@
|
|||||||
|
|
||||||
|
alter table "public"."workspaces" rename column "domain_name" to "name";
|
||||||
|
|
||||||
alter table "public"."workspaces" add constraint "workspaces_domain_name_key" unique (domain_name);
|
alter table "public"."workspaces" add constraint "workspaces_domain_name_key" unique (domain_name);
|
||||||
alter table "public"."workspaces" alter column "domain_name" drop not null;
|
alter table "public"."workspaces" alter column "domain_name" drop not null;
|
||||||
alter table "public"."workspaces" add column "domain_name" text;
|
alter table "public"."workspaces" add column "domain_name" text;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
DROP TABLE "public"."workspace_members";
|
||||||
55
hasura/migrations/default/1682338781740_squashed/up.sql
Normal file
55
hasura/migrations/default/1682338781740_squashed/up.sql
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
|
||||||
|
CREATE TABLE "public"."workspace_members" ("id" serial NOT NULL, "user_id" uuid NOT NULL, "workspace_id" integer NOT NULL, PRIMARY KEY ("id") , FOREIGN KEY ("user_id") REFERENCES "auth"."users"("id") ON UPDATE restrict ON DELETE restrict, FOREIGN KEY ("workspace_id") REFERENCES "public"."workspaces"("id") ON UPDATE restrict ON DELETE restrict, UNIQUE ("id"), UNIQUE ("user_id"));
|
||||||
|
|
||||||
|
alter table "public"."workspace_members" add column "created_at" timestamptz
|
||||||
|
not null default now();
|
||||||
|
|
||||||
|
alter table "public"."workspace_members" add column "updated_at" timestamptz
|
||||||
|
not null default now();
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_updated_at"()
|
||||||
|
RETURNS TRIGGER AS $$
|
||||||
|
DECLARE
|
||||||
|
_new record;
|
||||||
|
BEGIN
|
||||||
|
_new := NEW;
|
||||||
|
_new."updated_at" = NOW();
|
||||||
|
RETURN _new;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
CREATE TRIGGER "set_public_workspace_members_updated_at"
|
||||||
|
BEFORE UPDATE ON "public"."workspace_members"
|
||||||
|
FOR EACH ROW
|
||||||
|
EXECUTE PROCEDURE "public"."set_current_timestamp_updated_at"();
|
||||||
|
COMMENT ON TRIGGER "set_public_workspace_members_updated_at" ON "public"."workspace_members"
|
||||||
|
IS 'trigger to set value of column "updated_at" to current timestamp on row update';
|
||||||
|
|
||||||
|
alter table "public"."workspace_members" add column "deleted_at" timestamptz
|
||||||
|
null;
|
||||||
|
|
||||||
|
CREATE OR REPLACE FUNCTION "public"."set_current_timestamp_deleted_at"()
|
||||||
|
RETURNS TRIGGER AS $$
|
||||||
|
DECLARE
|
||||||
|
_new record;
|
||||||
|
BEGIN
|
||||||
|
_new := NEW;
|
||||||
|
_new."deleted_at" = NOW();
|
||||||
|
RETURN _new;
|
||||||
|
END;
|
||||||
|
$$ LANGUAGE plpgsql;
|
||||||
|
CREATE TRIGGER "set_public_workspace_members_deleted_at"
|
||||||
|
BEFORE UPDATE ON "public"."workspace_members"
|
||||||
|
FOR EACH ROW
|
||||||
|
EXECUTE PROCEDURE "public"."set_current_timestamp_deleted_at"();
|
||||||
|
COMMENT ON TRIGGER "set_public_workspace_members_deleted_at" ON "public"."workspace_members"
|
||||||
|
IS 'trigger to set value of column "deleted_at" to current timestamp on row update';
|
||||||
|
|
||||||
|
alter table "public"."workspaces" add column "domain_name" text
|
||||||
|
null unique;
|
||||||
|
|
||||||
|
alter table "public"."workspaces" drop column "domain_name" cascade;
|
||||||
|
|
||||||
|
alter table "public"."workspaces" rename column "name" to "domain_name";
|
||||||
|
|
||||||
|
alter table "public"."workspaces" add column "deleted_at" Timestamp
|
||||||
|
null;
|
||||||
Reference in New Issue
Block a user