Closed karenc closed 7 years ago
On the prod database:
cnxarchive=# select * from schema_migrations order by version;
version | applied
----------------+-------------------------------
20160101000000 | 2016-06-10 06:15:39.323207+02
20160104115058 | 2016-06-10 07:05:50.081735+02
20160128110515 | 2016-06-10 06:46:51.34293+02
20160128111115 | 2016-06-10 07:05:51.207721+02
20160308064742 | 2016-06-10 07:05:52.081576+02
20160309072525 | 2016-06-10 07:21:48.126611+02
20160314200432 | 2016-06-10 07:23:29.640983+02
20160423022147 | 2016-06-10 07:23:30.747354+02
(8 rows)
There are 2 migrations in cnx-db that ran are not in the schema_migrations table:
In order to be able to run migrations again, we need to do mark those migrations as completed:
dbmigrator --db-connection-string='dbname=cnxarchive user=cnxarchive' mark -t 20160506121704
dbmigrator --db-connection-string='dbname=cnxarchive user=cnxarchive' mark -t 20160506125405
Staging is a copy of production, so those should be:
dbmigrator --db-connection-string='dbname=repository user=rhaptos' mark -t 20160506121704
dbmigrator --db-connection-string='dbname=repository user=rhaptos' mark -t 20160506125405
We've now migrated all databases so closing this.
Summary
When running main.yml on staging, the database migration handler failed:
To make it easier to read, the traceback:
There are 2 problems:
cnx-db
migrations should not run because archive and publishing are running code that predatescnx-db
.Environment
staging (and probably prod)