© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
SupabaseS
Supabase•4y ago
sudoramen

Referencing file in Migration

Hi, this might be more of a postgres question but I'm trying to organize my scripts in a way to where say I want to reference or update a table, I could just alter the sql file at say
supabase/tables/table_name.sql
supabase/tables/table_name.sql
. To add this table in my DB, I run a new migration with the line
\i supabase/tables/table_name.sql
\i supabase/tables/table_name.sql
but I'm getting
Error: Error starting database: supabase/tables/table_name.sql: No such file or directory
Error: Error starting database: supabase/tables/table_name.sql: No such file or directory
when I try to spin up Supabase.

Two questions,
1. What is the relative path when running
supabase start
supabase start
? Maybe I just have the wrong path in my migration script.
2. Is there a better way I could be organizing my scripts/migrations?

Thanks for any help!
Supabase banner
SupabaseJoin
Supabase gives you the tools, documentation, and community that makes managing databases, authentication, and backend infrastructure a lot less overwhelming.
45,816Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Malformed Migration File
SupabaseSSupabase / help-and-questions
7mo ago
Referencing other tables in RLS
SupabaseSSupabase / help-and-questions
4y ago
Rerun backup .sql file migration
SupabaseSSupabase / help-and-questions
7mo ago
Migration File Clean Up on Remote
SupabaseSSupabase / help-and-questions
7mo ago