S
Supabase2mo ago
L1MJH

Branching did not copy existing schema

This is the error in the newly branched logs I got. And my new branch is baisically an empty schema and it did not copied the schema from my main branch.
2025/09/18 15:31:14 INFO Cloning git repo... git_ref=develop
2025/09/18 15:31:16 INFO Pulling migrations from database... host=[2406:da18:243:7404:5ccc:ef81:dc80:6e7a]:5432
2025/09/18 15:31:18 INFO Pulling migrations from database... host=[2406:da18:243:7402:c4f0:7f5:d499:9d24]:5432
2025/09/18 15:31:20 INFO Checking service health... project_ref=guqmrcahybpldqozjgbf
2025/09/18 15:31:21 INFO Config file not found... path=supabase/config.toml
2025/09/18 15:31:27 INFO Connecting to database... host=[2406:da18:243:7402:c4f0:7f5:d499:9d24]:5432
Applying migration 20250918150236_remote_schema.sql...
2025/09/18 15:31:32 ERROR: syntax error at or near "\" (SQLSTATE 42601)
At statement: 0
\restrict GauUeFThDV7lfECbw6301gdslstzo0YNiJcn9To9nBRUed5K3ICP3gXqU9JMhbx
^
2025/09/18 15:31:14 INFO Cloning git repo... git_ref=develop
2025/09/18 15:31:16 INFO Pulling migrations from database... host=[2406:da18:243:7404:5ccc:ef81:dc80:6e7a]:5432
2025/09/18 15:31:18 INFO Pulling migrations from database... host=[2406:da18:243:7402:c4f0:7f5:d499:9d24]:5432
2025/09/18 15:31:20 INFO Checking service health... project_ref=guqmrcahybpldqozjgbf
2025/09/18 15:31:21 INFO Config file not found... path=supabase/config.toml
2025/09/18 15:31:27 INFO Connecting to database... host=[2406:da18:243:7402:c4f0:7f5:d499:9d24]:5432
Applying migration 20250918150236_remote_schema.sql...
2025/09/18 15:31:32 ERROR: syntax error at or near "\" (SQLSTATE 42601)
At statement: 0
\restrict GauUeFThDV7lfECbw6301gdslstzo0YNiJcn9To9nBRUed5K3ICP3gXqU9JMhbx
^
No description
10 Replies
ihm40
ihm402mo ago
check the schema in your migrations file, i think they have an error that comes from db pull this message chain https://discord.com/channels/839993398554656828/1416137881151344825/1416137881151344825 might be helpful where it suggests using a newer cli version
L1MJH
L1MJHOP2mo ago
I removed the schema migration files by deleting the tables in supabase_migrations, and now it only copied the edge functions but not the schema.
2025/09/18 16:11:57 INFO Cloning git repo... git_ref=develop
2025/09/18 16:11:58 INFO Pulling migrations from database... host=[2406:da18:243:7404:5ccc:ef81:dc80:6e7a]:5432
2025/09/18 16:12:00 INFO Pulling migrations from database... host=[2406:da18:243:7415:a4fe:45c1:4a4b:55a2]:5432
2025/09/18 16:12:02 INFO Checking service health... project_ref=rpxufdbxvmqjqsnpazcq
2025/09/18 16:12:03 INFO Config file not found... path=supabase/config.toml
2025/09/18 16:12:06 INFO Connecting to database... host=[2406:da18:243:7415:a4fe:45c1:4a4b:55a2]:5432
2025/09/18 16:12:08 INFO All migrations are up to date.
2025/09/18 16:12:10 INFO No buckets found. Try setting [storage.buckets.name] in config.toml.
2025/09/18 16:12:10 INFO Seeding data for development branch...
WARN: no files matched pattern: supabase/seed.sql
2025/09/18 16:12:12 INFO Downloading function... slug=find-instagram-profile
Deploying Function: find-instagram-profile (script size: 6.687kB)
2025/09/18 16:11:57 INFO Cloning git repo... git_ref=develop
2025/09/18 16:11:58 INFO Pulling migrations from database... host=[2406:da18:243:7404:5ccc:ef81:dc80:6e7a]:5432
2025/09/18 16:12:00 INFO Pulling migrations from database... host=[2406:da18:243:7415:a4fe:45c1:4a4b:55a2]:5432
2025/09/18 16:12:02 INFO Checking service health... project_ref=rpxufdbxvmqjqsnpazcq
2025/09/18 16:12:03 INFO Config file not found... path=supabase/config.toml
2025/09/18 16:12:06 INFO Connecting to database... host=[2406:da18:243:7415:a4fe:45c1:4a4b:55a2]:5432
2025/09/18 16:12:08 INFO All migrations are up to date.
2025/09/18 16:12:10 INFO No buckets found. Try setting [storage.buckets.name] in config.toml.
2025/09/18 16:12:10 INFO Seeding data for development branch...
WARN: no files matched pattern: supabase/seed.sql
2025/09/18 16:12:12 INFO Downloading function... slug=find-instagram-profile
Deploying Function: find-instagram-profile (script size: 6.687kB)
ihm40
ihm402mo ago
are you using github here? if you delete the tables then it wouldn't have any schema to copy over
L1MJH
L1MJHOP2mo ago
Yes I am using GitHub since it’s required for me to link to GitHub. But I only delete the tables in supabase migration. I suppose they use that sql to migrate the schema Is there any way for me to restore it back
ihm40
ihm402mo ago
The first option is using git to get an earlier copy of the files, find the commit where you made the change where git log -n provides the last n commits (pick n to be large enough to see your change) Then copy the files from there. The main issue that you might face now is that if you have deleted migration files, your remote/local database might go out of sync.
ihm40
ihm402mo ago
Also github is no longer a requirement since this article https://supabase.com/blog/branching-2-0
Introducing Branching 2.0
Create, review and merge Supabase branches all within the dashboard.
L1MJH
L1MJHOP2mo ago
I saw the article but I am not sure why my supabase still required me to sync with github
No description
ihm40
ihm402mo ago
ahh i think you need to enable it via user icon click -> branching via dashboard -> enable but if you are using github then there is no need i don't use it since i prefer the github flow
L1MJH
L1MJHOP2mo ago
I've enabled branching via dahsboard, and got back my prev migration files, it now copied the schema but not the edge functions. This is the logs
ihm40
ihm402mo ago
That's strange, i just created a branch now (using the new feature) and the functions did not have any issues These logs are from workflow in the branch and your functions a deployed on main?

Did you find this page helpful?