Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Can't generate migration
  • Every time I try to generate any migration I get this error:

    $ php oil generate migration update_users_nullable_password_reset
    Uncaught exception Exception: No migration could be generated. Please verify your command syntax.
    Callstack: 
    #0 [internal function]: Oil\Generate::migration(Array)
    #1 /home/huertanix/www/coolappbro/fuel/packages/oil/classes/command.php(68): call_user_func('Oil\Generate::m...', Array)
    #2 /home/huertanix/www/coolappbro/oil(57): Oil\Command::init(Array)
    #3 {main}

    I'm running FuelPHP 1.7.0. The scaffolding which generated the users table was able to generate a migration just fine but I can't generate one by hand, no matter what name I give it. Any ideas?
  • I'm not sure it understands "update_users_nullable_password_reset". I'm not sure I do... ;-)
  • I figured it would use a basic skeleton; Something like an Update_Users class and empty up/down functions--I can't recall if other frameworks have a similar design, somehow I expected it. I ended up migrating down, editing the existing migration file, then migrating up.

    ...however,

    I tried doing that again with a different change: renaming a column from "group" (which MySQL is too advanced to not understand the context of its own syntax to realize it is a columns name) to "group_id." I made the change, migrated down, but when I tried to migrate up it said I was already at the latest migration, which isn't the case:

    $ php oil refine migrate:up
    You are already on the latest migration version for app:default.
    $ php oil refine migrate:down
    There are no migrations installed to revert for app:default.
    $ php oil refine migrate:up
    You are already on the latest migration version for app:default.

    I seem to be stuck in limbo and can't figure out how to escape.
  • hmm... that should work just fine.

    You're in the correct environment (like that you're using 'development')?

    Can you check the contents of your app/config/development/migrations.php contents, and compare it with the contents of the migrations table? Any discrepancies?
  • Ah, just found the problem; There was a migration ran by another developer's build that was applied to the database, but that migration wasn't in my build at the time. Once I had the actual migration file it worked.
  • I believe this caused by the magic migrations. Do we have option to disable this feature? IMHO it's quite painful.
  • What is a "magic" migration?

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion