-
Notifications
You must be signed in to change notification settings - Fork 104
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
Integrity constraint violation Obj::createFromArray($array) #73
Comments
Update your package, please. I had an email from you sent by Github where the message was about missing Notice that you need to migrate your tables again to make them properly set. |
The package has been updated, and I have migrated the tables again. The other issues were fixed by the package update but this is an additional one. The other foreign key issue occurred when migrating the database but this issue occurs when you are seeding the database. But just incase I had originally messed something up I just checked again to make sure, and the issue persists. |
Did you try to |
I just tested it and I got the same result. I also tried removing position, but the same error popped up. |
Hi @kmccarthyweb, Do you still experience the same issue as mentioned in your original post? From the error displayed in the query, it seems that neither the id nor the name fields are being saved (only the position = 0 and real_depth = 0). This seems like a buggy behavior to me. Second, do you get any errors if you run the test suite of this package? That is, does EntityTestCase::testCreateFromArray give you an error? Out of curiosity, what database software are you using? MySQL, PostgreSQL, etc.? |
I am still having the issue. I am using MySQL. I added the
When I try to seed the database I get the following error:
|
Hi @kmccarthyweb, Could you please generate the SQL code that would generate the tables? Or provide us with the migration files you are running? It would seem that your `parent_id` int(10) unsigned NOT NULL, should be `parent_id` int(10) unsigned DEFAULT NULL, |
@kmccarthyweb, maybe you haven't run |
@tomzx After looking at the database in SequelPro it looks like you're right. parent_id doesn't allow null and has no default. Here are my migrations:
@dominiczaq I ran |
@kmccarthyweb, please run the |
@dominiczaq You're right. I hadn't noticed it didn't run the migration again. My mistake. Everything works as it should now! Thanks! |
When you run
You get the error:
I generated the database using:
The text was updated successfully, but these errors were encountered: