cli icon indicating copy to clipboard operation
cli copied to clipboard

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

Open irbhatia opened this issue 1 year ago • 3 comments

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

irbhatia avatar Aug 14 '24 13:08 irbhatia

^^ @sweatybridge

irbhatia avatar Aug 14 '24 15:08 irbhatia

Would you consider using unix pipes which is supported currently?

cat other_migration.sql | supabase migration new my_migration

sweatybridge avatar Aug 14 '24 15:08 sweatybridge

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

irbhatia avatar Aug 14 '24 22:08 irbhatia