Closed mmulich closed 8 years ago
It works for me:
karen@trusty:~/cnx-archive (master)$ dbmigrator --context=cnx-archive --context=cnx-publishing --config=development.ini list
[WARNING] dbmigrator (utils.py) - relation "schema_migrations" does not exist
LINE 1: SELECT * FROM schema_migrations ORDER BY version
^
[WARNING] dbmigrator (utils.py) - You may need to run "dbmigrator init" to create the schema_migrations table
name | is applied | date applied
----------------------------------------------------------------------
20160101000000_update_fil False
20160104115058_add_api_ke False
20160128110515_mimetype_o False
20160128111115_mimetype_r False
20160308064742_unique_fil False
20160314200432_remove_xml False
karen@trusty:~/cnx-archive (master)$ dbmigrator --context=cnx-archive --context=cnx-publishing --config=development.ini init
Schema migrations initialized.
karen@trusty:~/cnx-archive (master)$ dbmigrator --context=cnx-archive --context=cnx-publishing --config=development.ini list
name | is applied | date applied
----------------------------------------------------------------------
20160101000000_update_fil True 2016-03-31 14:06:23.090221+01:00
20160104115058_add_api_ke True 2016-03-31 14:06:23.090221+01:00
20160128110515_mimetype_o True 2016-03-31 14:06:23.090221+01:00
20160128111115_mimetype_r True 2016-03-31 14:06:23.090221+01:00
20160308064742_unique_fil True 2016-03-31 14:06:23.090221+01:00
20160314200432_remove_xml True 2016-03-31 14:06:23.090221+01:00
I added a test for this in #29.
It appears that
dbmigrator --context cnx-archive --context cnx-publishing init
only uses one of the contexts while initializing. So, it only pre-inserts migrations for cnx-archive, but not cnx-publishing. :stuck_out_tongue: