adriangb / asyncpg-trek

Simple migrations system for asyncpg
MIT License
9 stars 3 forks source link

Default schema for the migrations table #7

Closed euri10 closed 1 year ago

euri10 commented 1 year ago

Currently the public schema is the default for creating the migrations table, there doesnt seem to be a way to create it elsewhere.

I'd be tempted to say it is a bad idea because:

  1. you may have another migrations table inside that public schema and it leaves you no options.
  2. running execute on a schema where there is no migrations table will fail

What do you think of this: asyncpg-trek creates its own schema to handle migrations, and uses a migrations table inside it, low chances of conflicts, and you are able to run migrations on others schema, asyncpg-trek always knows where to find its migrations table

adriangb commented 1 year ago

What do you think of this: asyncpg-trek creates its own schema to handle migrations

One huge issue: you're not always allowed to create your own schemas on certain hosted Postgres offerings. I think it should be an option but not the default.

euri10 commented 1 year ago

oh I didn't know that, how people can live without ? but yeah so optional makes more sense in that case you're right.

adriangb commented 1 year ago

PR welcome 😄