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

Migrations not working "Cannot declare class Table, because the name is already in use" after Laravel ^8.38 update #343

Open
yoramdelangen opened this issue May 14, 2021 · 8 comments
Assignees

Comments

@yoramdelangen
Copy link

yoramdelangen commented May 14, 2021

Hi, this is just a heads up for when Laravel-zero will be updated to later version of Laravel Framework >= 8.38.0 or higher.

They introduced "Allow anonymous and class based migration coexisting" and they're using realpath to check if the filename is equally the class filename (not sure why though).

Currently it breaks Laravel-zero project(s) when updating, so fixed it for now to "downgrade/static" version to 8.37.*.

References:
laravel/framework@ee78372

I will try to fix it within the framework and make a pull request.

For future references; I don't think PHP will ever gonna support realpath for different file streams than file://:

@yoramdelangen yoramdelangen changed the title Migrations not working "Cannot declare class CreateMappingTable, because the name is already in use" after Laravel update Migrations not working "Cannot declare class Table, because the name is already in use" after Laravel ^8.38 update May 14, 2021
@mathewparet
Copy link

@yoramdelangen I changed laravel/framework entry in composer.lock to 8.37 but it still didn't help.

Either that's not the fix, or I am doing it wrong.

@yoramdelangen
Copy link
Author

@yoramdelangen I changed laravel/framework entry in composer.lock to 8.37 but it still didn't help.

Either that's not the fix, or I am doing it wrong.

You have to set it fixed in your composer.json file. Otherwise it will be discarded at composer update

@mathewparet
Copy link

mathewparet commented Jun 25, 2021 via email

@yoramdelangen
Copy link
Author

Just add it in, it will make it fixed

@mathewparet
Copy link

You are talking about adding it to composer.json in my project's root folder, right? It didn't work for me.

@tobytwigger
Copy link

tobytwigger commented Jul 5, 2021

@mathewparet I tried adding the following to composer.json under require, and it lets me work around this issue

"require": {
    ...,
    "illuminate/database": "8.37.*"
}

@tobytwigger
Copy link

@yoramdelangen Do you have ideas as to how to fix the issue in the framework? I'd be very happy to do it, just not sure of the right direction!

@mathewparet
Copy link

@mathewparet I tried adding the following to composer.json under require, and it lets me work around this issue

"require": {
    ...,
    "illuminate/database": "8.37.*"
}

This worked after I deleted the composer.lock file

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

No branches or pull requests

4 participants