The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Fix
Charles Bochet7ae7efb5232e
diff --git a/hasura/migrations/default/1682141330851_create_table_public_workspace_members/down.sql b/hasura/migrations/default/1682141330851_create_table_public_workspace_members/down.sqldeleted file mode 100644index 17131d84ea3..00000000000--- a/hasura/migrations/default/1682141330851_create_table_public_workspace_members/down.sql+++ /dev/null@@ -1 +0,0 @@-DROP TABLE "public"."workspace_members";diff --git a/hasura/migrations/default/1682141330851_create_table_public_workspace_members/up.sql b/hasura/migrations/default/1682141330851_create_table_public_workspace_members/up.sqldeleted file mode 100644index 835f01b2d46..00000000000--- a/hasura/migrations/default/1682141330851_create_table_public_workspace_members/up.sql+++ /dev/null@@ -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"));diff --git a/hasura/migrations/default/1682141433503_alter_table_public_workspace_members_add_column_created_at/down.sql b/hasura/migrations/default/1682141433503_alter_table_public_workspace_members_add_column_created_at/down.sqldeleted file mode 100644index 43fcc7a4e77..00000000000--- a/hasura/migrations/default/1682141433503_alter_table_public_workspace_members_add_column_created_at/down.sql+++ /dev/null@@ -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();diff --git a/hasura/migrations/default/1682141433503_alter_table_public_workspace_members_add_column_created_at/up.sql b/hasura/migrations/default/1682141433503_alter_table_public_workspace_members_add_column_created_at/up.sqldeleted file mode 100644index 6e48494ea2d..00000000000--- a/hasura/migrations/default/1682141433503_alter_table_public_workspace_members_add_column_created_at/up.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table "public"."workspace_members" add column "created_at" timestamptz- not null default now();diff --git a/hasura/migrations/default/1682141443863_alter_table_public_workspace_members_add_column_updated_at/down.sql b/hasura/migrations/default/1682141443863_alter_table_public_workspace_members_add_column_updated_at/down.sqldeleted file mode 100644index 47993769d56..00000000000--- a/hasura/migrations/default/1682141443863_alter_table_public_workspace_members_add_column_updated_at/down.sql+++ /dev/null@@ -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';diff --git a/hasura/migrations/default/1682141443863_alter_table_public_workspace_members_add_column_updated_at/up.sql b/hasura/migrations/default/1682141443863_alter_table_public_workspace_members_add_column_updated_at/up.sqldeleted file mode 100644index 2eb2da7f7b7..00000000000--- a/hasura/migrations/default/1682141443863_alter_table_public_workspace_members_add_column_updated_at/up.sql+++ /dev/null@@ -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';diff --git a/hasura/migrations/default/1682141457260_alter_table_public_workspace_members_add_column_deleted_at/down.sql b/hasura/migrations/default/1682141457260_alter_table_public_workspace_members_add_column_deleted_at/down.sqldeleted file mode 100644index 34346f439db..00000000000--- a/hasura/migrations/default/1682141457260_alter_table_public_workspace_members_add_column_deleted_at/down.sql+++ /dev/null@@ -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';diff --git a/hasura/migrations/default/1682141457260_alter_table_public_workspace_members_add_column_deleted_at/up.sql b/hasura/migrations/default/1682141457260_alter_table_public_workspace_members_add_column_deleted_at/up.sqldeleted file mode 100644index 64b2222a082..00000000000--- a/hasura/migrations/default/1682141457260_alter_table_public_workspace_members_add_column_deleted_at/up.sql+++ /dev/null@@ -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';diff --git a/hasura/migrations/default/1682337427850_alter_table_public_workspaces_add_column_domain_name/down.sql b/hasura/migrations/default/1682337427850_alter_table_public_workspaces_add_column_domain_name/down.sqldeleted file mode 100644index 965641ba8b8..00000000000--- a/hasura/migrations/default/1682337427850_alter_table_public_workspaces_add_column_domain_name/down.sql+++ /dev/null@@ -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;diff --git a/hasura/migrations/default/1682337427850_alter_table_public_workspaces_add_column_domain_name/up.sql b/hasura/migrations/default/1682337427850_alter_table_public_workspaces_add_column_domain_name/up.sqldeleted file mode 100644index ff09f675f38..00000000000--- a/hasura/migrations/default/1682337427850_alter_table_public_workspaces_add_column_domain_name/up.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table "public"."workspaces" add column "domain_name" text- null unique;diff --git a/hasura/migrations/default/1682337605938_alter_table_public_workspaces_drop_column_domain_name/up.sql b/hasura/migrations/default/1682337605938_alter_table_public_workspaces_drop_column_domain_name/up.sqldeleted file mode 100644index 75bb197fe40..00000000000--- a/hasura/migrations/default/1682337605938_alter_table_public_workspaces_drop_column_domain_name/up.sql+++ /dev/null@@ -1 +0,0 @@-alter table "public"."workspaces" drop column "domain_name" cascade;diff --git a/hasura/migrations/default/1682337614489_alter_table_public_workspaces_alter_column_name/down.sql b/hasura/migrations/default/1682337614489_alter_table_public_workspaces_alter_column_name/down.sqldeleted file mode 100644index fc016a35d37..00000000000--- a/hasura/migrations/default/1682337614489_alter_table_public_workspaces_alter_column_name/down.sql+++ /dev/null@@ -1 +0,0 @@-alter table "public"."workspaces" rename column "domain_name" to "name";diff --git a/hasura/migrations/default/1682337614489_alter_table_public_workspaces_alter_column_name/up.sql b/hasura/migrations/default/1682337614489_alter_table_public_workspaces_alter_column_name/up.sqldeleted file mode 100644index 256e5ffa10d..00000000000--- a/hasura/migrations/default/1682337614489_alter_table_public_workspaces_alter_column_name/up.sql+++ /dev/null@@ -1 +0,0 @@-alter table "public"."workspaces" rename column "name" to "domain_name";diff --git a/hasura/migrations/default/1682338781740_alter_table_public_workspaces_add_column_deleted_at/down.sql b/hasura/migrations/default/1682338781740_alter_table_public_workspaces_add_column_deleted_at/down.sqldeleted file mode 100644index 7fd42c852eb..00000000000--- a/hasura/migrations/default/1682338781740_alter_table_public_workspaces_add_column_deleted_at/down.sql+++ /dev/null@@ -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;diff --git a/hasura/migrations/default/1682338781740_alter_table_public_workspaces_add_column_deleted_at/up.sql b/hasura/migrations/default/1682338781740_alter_table_public_workspaces_add_column_deleted_at/up.sqldeleted file mode 100644index a72ce728e31..00000000000--- a/hasura/migrations/default/1682338781740_alter_table_public_workspaces_add_column_deleted_at/up.sql+++ /dev/null@@ -1,2 +0,0 @@-alter table "public"."workspaces" add column "deleted_at" Timestamp- null;diff --git a/hasura/migrations/default/1682337605938_alter_table_public_workspaces_drop_column_domain_name/down.sql b/hasura/migrations/default/1682338781740_squashed/down.sqlsimilarity index 66%rename from hasura/migrations/default/1682337605938_alter_table_public_workspaces_drop_column_domain_name/down.sqlrename to hasura/migrations/default/1682338781740_squashed/down.sqlindex 92f9c9d61ce..cf8f11d7343 100644--- a/hasura/migrations/default/1682337605938_alter_table_public_workspaces_drop_column_domain_name/down.sql+++ b/hasura/migrations/default/1682338781740_squashed/down.sql@@ -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" alter column "domain_name" drop not null;alter table "public"."workspaces" add column "domain_name" text;++++DROP TABLE "public"."workspace_members";diff --git a/hasura/migrations/default/1682338781740_squashed/up.sql b/hasura/migrations/default/1682338781740_squashed/up.sqlnew file mode 100644index 00000000000..0c847729492--- /dev/null+++ b/hasura/migrations/default/1682338781740_squashed/up.sql@@ -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;