Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

supabase migration new should take a new flag -sql-from-file #2616

Open
irohitb opened this issue Aug 14, 2024 · 3 comments
Open

supabase migration new should take a new flag -sql-from-file #2616

irohitb opened this issue Aug 14, 2024 · 3 comments

Comments

@irohitb
Copy link

irohitb commented Aug 14, 2024

Is your feature request related to a problem? Please describe.

I want to apply new migrations from a file instead of always using db diff command.

Similar to how hasura `-sql-from-file`` option

https://hasura.io/docs/latest/hasura-cli/commands/hasura_migrate_create/

Describe the solution you'd like

supabase migration new should take a new flag -sql-from-file

Describe alternatives you've considered

Currently, I would do supabase migration new schema_test and then manually copy-paste my migration.

I am building a cli which takes the difference from my source tree and apply migrations with more context (easier to review) instead of supabase creating migrations using supabase db diff

PS: Would like to/insist on creating a PR to add this feature if others also think it would be useful

@irohitb
Copy link
Author

irohitb commented Aug 14, 2024

^^ @sweatybridge

@sweatybridge
Copy link
Contributor

Would you consider using unix pipes which is supported currently?

cat other_migration.sql | supabase migration new my_migration

@irohitb
Copy link
Author

irohitb commented Aug 14, 2024

@sweatybridge that works but do you think it won't be a good to have feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants