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
Users Table getting duplicated after initial migrate:auto #3
Comments
the package should be removing that "table_users" table, as its only supposed to be a temporary table created to diff the actual table. also, make sure the user migration file that comes with laravel itself is deleted. |
Yeah, the |
Ahhh, i didn't test with postgres. I only use MySQL or MariaDB. I'm unsure how to fix for postgres. It may be an issue with either Laravel or Doctrine in how their DTO's handle the stuff. Closing for now as I have no time or idea how to fix this for postgres. If you figure out a solution please feel free to submit a PR. |
I'm testing this package and I have the same issue on PostgreSQL.
The primary Key has also a index and it should have the same problem, but instead the Comparator class make a different check if the ->isPrimary attribute is set on the index. I edited your code to manipulate the tableDiff and make it work. And it works. Here is my edit on MigrateAutoCommand.php:
I scan all indexes on the temp table and rename the index which are NOT primary fto delete the "table_" part. I am not sure this will cover every issue with indexes but this specific problem seems resolved. I hope you find this hint useful Bye |
Hello,
Whenever I run the migrate:auto command after the initial users table has been created, the command creates a new table called "table_users". I have a video demonstrating the issue happening on a fresh laravel project, (you can skip through to around 01:28 as it takes it's sweet time to create a new project on windows!): Video Link. It has the following error:
The text was updated successfully, but these errors were encountered: