I had to restore backup of my development sqlite database from November
last year and it turns out I can't migrate anymore to develop:
== FixPuppetclassTotalHosts: migrating =======================================
** Invoke puppet:fix_total_hosts (first_time)
** Invoke environment
** Execute puppet:fix_total_hosts
StandardError: An error has occurred, this and all later migrations canceled:
ERF42-6794 [Foreman::Exception]: Anonymous admin user foreman_admin is missing, run foreman-rake db:seed/home/lzap/work/foreman/app/models/user.rb:168:in
anonymous_admin' /home/lzap/work/foreman/lib/tasks/puppet.rake:223:inblock (2 levels) in <top (required)>'
When I try to seed, I am given an advice to migrate
You have 10 pending migrations:
rake db:migrate to update your database then try again.
We use a rake task from migration which is not the best thing to do I think
since rake tasks boot whole environment.
To proceed, one needs to comment out the following migration:
Migrate, seed, uncomment and migrate again. I filed a bug, fix is easy. Leaving
this just for the record.