Repository: supabase/cli
Pull request #769 (2023-01-06 04:57:55)

fix: change Realtime demo project from realtime-demo to realtime-dev
## What kind of change does this PR introduce?

Bug fix

## What is the current behavior?

Realtime demo still references `realtime-demo`.

## What is the new behavior?

Realtime demo refers to `realtime-dev` project and Realtime spin up relies more on Realtime docker image and its migrations.



Patch:
diff --git a/internal/start/templates/kong_config b/internal/start/templates/kong_config
index c9e41c7d..a09b4faa 100644
--- a/internal/start/templates/kong_config
+++ b/internal/start/templates/kong_config
@@ -76,7 +76,7 @@ services:
               - "Content-Profile: graphql_public"
   - name: realtime-v1
     _comment: "Realtime: /realtime/v1/* -> ws://realtime:4000/socket/*"
-    url: http://realtime-demo.supabase_realtime_{{ .ProjectId }}:4000/socket
+    url: http://realtime-dev.supabase_realtime_{{ .ProjectId }}:4000/socket
     routes:
       - name: realtime-v1-all
         strip_path: true
diff --git a/internal/utils/config.go b/internal/utils/config.go
index 4c89b1e5..d9c9fdd8 100644
--- a/internal/utils/config.go
+++ b/internal/utils/config.go
@@ -168,7 +168,7 @@ func LoadConfigFS(fsys afero.Fs) error {
 			KongId = "supabase_kong_" + Config.ProjectId
 			GotrueId = "supabase_auth_" + Config.ProjectId
 			InbucketId = "supabase_inbucket_" + Config.ProjectId
-			RealtimeId = "realtime-demo.supabase_realtime_" + Config.ProjectId
+			RealtimeId = "realtime-dev.supabase_realtime_" + Config.ProjectId
 			RestId = "supabase_rest_" + Config.ProjectId
 			StorageId = "supabase_storage_" + Config.ProjectId
 			ImgProxyId = "storage_imgproxy_" + Config.ProjectId
diff --git a/internal/utils/misc.go b/internal/utils/misc.go
index d3621f87..063c9ef0 100644
--- a/internal/utils/misc.go
+++ b/internal/utils/misc.go
@@ -41,7 +41,7 @@ const (
 	// Update initial schemas in internal/utils/templates/initial_schemas when
 	// updating any one of these.
 	GotrueImage   = "supabase/gotrue:v2.36.1"
-	RealtimeImage = "supabase/realtime:v2.0.0"
+	RealtimeImage = "supabase/realtime:v2.0.2"
 	StorageImage  = "supabase/storage-api:v0.26.1"
 	// Should be kept in-sync with DenoRelayImage
 	DenoVersion = "1.28.0"
diff --git a/internal/utils/templates/initial_schemas/15.sql b/internal/utils/templates/initial_schemas/15.sql
index 50ff1ecb..3240f2ef 100644
--- a/internal/utils/templates/initial_schemas/15.sql
+++ b/internal/utils/templates/initial_schemas/15.sql
@@ -1338,16 +1338,17 @@ INSERT INTO _realtime.extensions (id, type, settings, tenant_external_id, insert
 -- Data for Name: schema_migrations; Type: TABLE DATA; Schema: _realtime; Owner: postgres
 --
 
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20210706140551, '2022-12-15 04:27:09');
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220329161857, '2022-12-15 04:27:09');
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220410212326, '2022-12-15 04:27:09');
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220506102948, '2022-12-15 04:27:09');
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220527210857, '2022-12-15 04:27:09');
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815211129, '2022-12-15 04:27:09');
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815215024, '2022-12-15 04:27:09');
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220818141501, '2022-12-15 04:27:09');
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221018173709, '2022-12-15 04:27:09');
-INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221102172703, '2022-12-15 04:27:09');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20210706140551, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220329161857, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220410212326, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220506102948, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220527210857, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815211129, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220815215024, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20220818141501, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221018173709, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221102172703, '2023-01-06 05:02:45');
+INSERT INTO _realtime.schema_migrations (version, inserted_at) VALUES (20221223010058, '2023-01-06 05:02:45');
 
 
 --
@@ -1545,14 +1546,6 @@ ALTER TABLE ONLY _realtime.tenants
     ADD CONSTRAINT tenants_pkey PRIMARY KEY (id);
 
 
---
--- Name: tenants uniq_external_id; Type: CONSTRAINT; Schema: _realtime; Owner: postgres
---
-
-ALTER TABLE ONLY _realtime.tenants
-    ADD CONSTRAINT uniq_external_id UNIQUE (external_id);
-
-
 --
 -- Name: mfa_amr_claims amr_id_pk; Type: CONSTRAINT; Schema: auth; Owner: supabase_auth_admin
 --


Test patch:
diff --git a/internal/status/status_test.go b/internal/status/status_test.go
index 067e3ef1..55491ae0 100644
--- a/internal/status/status_test.go
+++ b/internal/status/status_test.go
@@ -24,7 +24,7 @@ func TestStatusCommand(t *testing.T) {
 			"supabase_kong_",
 			"supabase_auth_",
 			"supabase_inbucket_",
-			"realtime-demo.supabase_realtime_",
+			"realtime-dev.supabase_realtime_",
 			"supabase_rest_",
 			"supabase_storage_",
 			"supabase_pg_meta_",