contessa
contessa copied to clipboard
Support listing tables in migrations
hmm, we allow to change names for users. I wouldn't rely on this convention of table_prefix
then. I can think of 2 solutions:
-
Can we do it for all tables? in case of error just skip and log at the end. It should be configurable
fail-fast/fail-silently mode
for user in CLI (can be done later). Not sure if doable tho, cause dunno if e.g.op.alter_column
plans the queries or also executes them, so not sure if we can fail silently. -
We will go with
--table-prefix
option. if there's no prefix passed, we'll use the default one (it should be as a CONSTANT taken from Contessa repo btw). I would add option to pass list of tables (file, str, stdout) so people can define it themselves if they have other names and pass it in simple bash/python scirpt, e.g.python3 get_my_tables.py | contessa migration --etc --etc
while get my tables would connect to the database and retrieve tables by custom rules
Originally posted by @maroshmka in https://github.com/kiwicom/contessa/pull/51