Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migration File & Class Name Issues #437

Closed
SmolSoftBoi opened this issue Mar 9, 2017 · 6 comments
Closed

Migration File & Class Name Issues #437

SmolSoftBoi opened this issue Mar 9, 2017 · 6 comments

Comments

@SmolSoftBoi
Copy link
Contributor

SmolSoftBoi commented Mar 9, 2017

I am getting the error: The migration class "App\Database\Migrations\Migration_Init" could not be found. for my migration classes now.

application/Database/Migrations/00000000000001_Init.php

class Migration_Init extends Migration
{
}
@baselbj
Copy link
Contributor

baselbj commented Mar 9, 2017

Did you namespace your migration?

As in the latest update all migration files should have namespace:

App/Database/Migrations

@lonnieezell
Copy link
Member

Hmm. They shouldn't need to be namespaced. I just created one using the cli tool php ci.php migrate:create and ran the migration just fine. Here's what it's creating:

<?php

use CodeIgniter\Database\Migration;

class Migration_temp extends Migration
{
    public function up()
    {
        
    }

    //--------------------------------------------------------------------

    public function down()
    {
        //
    }
}

@baselbj
Copy link
Contributor

baselbj commented Mar 10, 2017

@lonnieezell I am sorry I think this should be fixed ... namespace is a must as we with the new migration update.

I will fix and make new poll request

@lonnieezell
Copy link
Member

@baselbj You're right. I had tried that while in a feature branch that didn't have the latest changes to the migrations.

@EpicKris Any update on this? Is your migration namespaced?

@SmolSoftBoi
Copy link
Contributor Author

@lonnieezell Sorry thought I'd already replied. Yes, adding the namespace worked a charm!

@lonnieezell
Copy link
Member

Ok, great. Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants