Rails schema & migrate keeps reverting to a VERSION=0 -
here basics. had deployment on sandbox environment.
i made changes, , attempted redeploy. stack cap3 postgres db / rails 4.2
upon deployment, has never had issues prior, when came run migrations, shouldn't have because there no pending ones, rolled of migrations 0 state.
i created error in development environment. had recover schema file previous commit, because reversion of course rolled back.
so right now.
activerecord::schema.define(version: 20151214201502) ...
and last migration file is
20151214201502_create_host_group_membership_table
when try , deploy, or run rake db:migrate total reversion. tables dropped.
schema.rb reads activerecord::schema.define(version: 0) do
and rake db:migrate:status reads >
status migration id migration name -------------------------------------------------- down 20150916151324 create ...<edited> table down 20150916190627 create ...<edited> table down 20150916195012 create ...<edited> table down 20150918112956 create ...<edited> table down 20151019175551 create ...<edited> table down 20151020195644 create ...<edited> table down 20151020202321 create ...<edited> table down 20151026021111 create ...<edited> table down 20151124161525 create ...<edited> table down 20151124185807 create ...<edited> table down 20151214201502 create ...<edited> table and subsequent rake db:migrate results in nothing.
if overwrite env["version"], rake db:migrate go downgrade rather upgrade if version smaller last known version in db schema, please check , avoid similar environment variable.
Comments
Post a Comment