New Branch Question

After creating a new branch (development) I want it to be identical to the current production branch (main) but the data is not required only the schemas, tables, functions, triggers, etc...
5 Replies
OakRatos
OakRatos2w ago
@malmazrou1993 use the “Branch from main” option when creating the new branch, which copies the schema (tables, functions, triggers, etc.) without the data. If you’ve already created it, you can run a migration dump from main and apply it to the development branch.
malmazrou1993
malmazrou1993OP2w ago
hi @OakRatos the only option I have when creating a branch is enable PITR and after creating I have the following options: 1-Reset branch 2-Switch to persistent 3-Delete branch 4-Create a pull request I also switch it from preview to persistent and vice versa still couldn't find this option nor in creating or editing am I missing something I also enabled all the Feature Previews
OakRatos
OakRatos2w ago
@malmazrou1993 supabase doesn’t currently offer a direct “branch from main without data” UI option for everyone. To achieve this, you can dump only the schema from the main branch using pg_dump --schema-only, then restore it into the new branch via psql. This will give you identical tables, functions, and triggers without copying any data.
malmazrou1993
malmazrou1993OP2w ago
thanks
OakRatos
OakRatos2w ago
Sounds Good 😊

Did you find this page helpful?