Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

fix email migration script

Jean-Baptiste Kaiserf2ce035a226f
diff --git a/makefile b/makefile
index 454f1ff4..d87dd7f3 100644
--- a/makefile
+++ b/makefile
@@ -12,6 +12,12 @@ start-supabase: ## start supabase locally
start-supabase-functions: ## start the supabase Functions watcher
npx supabase functions serve --env-file supabase/functions/.env.development
+supabase-migrate-database: ## apply the migrations to the database
+ npx supabase migration up
+
+supabase-reset-database: ## reset (and clear!) the database
+ npx supabase db reset
+
start-app: ## start the app locally
npm run dev
diff --git a/supabase/migrations/20250109152531_email_jsonb.sql b/supabase/migrations/20250109152531_email_jsonb.sql
index be5a74e4..435bca29 100644
--- a/supabase/migrations/20250109152531_email_jsonb.sql
+++ b/supabase/migrations/20250109152531_email_jsonb.sql
@@ -1,6 +1,6 @@
alter table contacts add column email_jsonb jsonb;
-update contacts set email_jsonb = ('[{"email": ' || email || ', "type": "Other"}]')::jsonb;
+update contacts set email_jsonb = ('[{"email": "' || email || '", "type": "Other"}]')::jsonb;
drop view contacts_summary;