From ee6efb6895ac32965acc3ed45e3c69463048d8d2 Mon Sep 17 00:00:00 2001 From: Pablo Gracia Gil Date: Thu, 7 Nov 2024 20:19:42 +0100 Subject: [PATCH] add supabase migrations and seeds --- supabase/config.toml | 2 +- supabase/help_requests.sql | 11 +++++++++++ ...01532_add-number-of-volunteers-in-each-request.sql | 1 + supabase/{seed.sql => towns.sql} | 0 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 supabase/help_requests.sql create mode 100644 supabase/migrations/20241107201532_add-number-of-volunteers-in-each-request.sql rename supabase/{seed.sql => towns.sql} (100%) diff --git a/supabase/config.toml b/supabase/config.toml index 0172bd1c..e1f41849 100644 --- a/supabase/config.toml +++ b/supabase/config.toml @@ -45,7 +45,7 @@ enabled = true # Specifies an ordered list of seed files to load during db reset. # Supports glob patterns relative to supabase directory. For example: # sql_paths = ['./seeds/*.sql', '../project-src/seeds/*-load-testing.sql'] -sql_paths = ['./seed.sql'] +sql_paths = ['./towns.sql', './help_requests.sql'] [realtime] enabled = true diff --git a/supabase/help_requests.sql b/supabase/help_requests.sql new file mode 100644 index 00000000..a37856da --- /dev/null +++ b/supabase/help_requests.sql @@ -0,0 +1,11 @@ +INSERT INTO "public"."help_requests" ("id","created_at","type","name","location","description","urgency","number_of_people","contact_info","additional_info","status","resources","latitude","longitude","help_type","people_needed","town_id","other_help") +VALUES ('10851', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Lorem Ipsum', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null), +('10852', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Lorem Ipsum', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null), +('10853', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Lorem Ipsum', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null), +('10854', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Me traslado desde r con l', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null), +('10855', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Me traslado desde r con l', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null), +('10856', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Me traslado desde r con l', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null), +('10857', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Me traslado desde r con l', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null), +('10858', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Me traslado desde r con l', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null), +('10859', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Me traslado desde r con l', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null), +('10860', '2024-11-07 18:31:47.83578+00', 'necesita', 'Rocío', '46200, P', 'Me traslado desde r con l', 'alta', '1', '123456789', '{"email": "ptesting@gmail.com", "consent": true, "special_situations": null}', 'active', null, '39.1', '-0.4', '{"alojamiento"}', '1', '17', null); \ No newline at end of file diff --git a/supabase/migrations/20241107201532_add-number-of-volunteers-in-each-request.sql b/supabase/migrations/20241107201532_add-number-of-volunteers-in-each-request.sql new file mode 100644 index 00000000..b9becac8 --- /dev/null +++ b/supabase/migrations/20241107201532_add-number-of-volunteers-in-each-request.sql @@ -0,0 +1 @@ +alter table "public"."help_requests" add column "asignees_count" smallint not null default '0'::smallint; \ No newline at end of file diff --git a/supabase/seed.sql b/supabase/towns.sql similarity index 100% rename from supabase/seed.sql rename to supabase/towns.sql