multicaret / laravel-acquaintances

This package gives Eloquent models the ability to manage friendships (with groups), followships along with Likes, favorites..etc.
https://laravel-news.com/manage-friendships-likes-and-more-with-the-acquaintances-laravel-package
MIT License
809 stars 72 forks source link

Migrations not working after upgrade #40

Closed francoism90 closed 3 years ago

francoism90 commented 3 years ago
SQLSTATE[HY000]: General error: 1005 Can't create table `laravel_dev`.`friendship_groups` (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table `friendship_groups` add constraint `friendship_groups_friendship_id_foreign` foreign key (`friendship_id`) references `friendships` (`id`) on delete cascade)

I have synced the config file, cleared the cache and the updated migrations.

usernotnull commented 3 years ago

+1

ghost commented 3 years ago

+1

mkwsra commented 3 years ago

Fixed in version v3.4.6, please give it a try.

Guys, I'm thinking of changing the migration file names to include the current year_month...., instead of 2018.... What do you think?

ghost commented 3 years ago

I’ve got no issue with that update. And thanks for the quick reply.

Sent from my iPhone

On Mar 18, 2021, at 10:07 PM, Mohamed Kawsara @.***> wrote:

 Fixed in version v3.4.6, please give it a try.

Guys, I'm thinking of changing the migration file names to include the current year_month...., instead of 2018.... What do you think?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

usernotnull commented 3 years ago

Issue fixed with 3.4.6

@mkwsra I'll tell you about my experience recently. When I first found this library, I noticed the date format of the migration file. It's the only library that has a fixed date format instead of the current date approach. I personally liked it because if I publish all the migrations, I do not have to suffer from having migration duplicates... Worst case, if the library has breaking changes and requires a different migration file, the owner of the lib can just bump the date, and the developer would notice.

Yet, none of the other Laravel libraries do this. Could it be because of a lack of interest in working more to achieve this (since it needs an extra couple of lines of code) or because there is something wrong with this approach? I didn't figure it out. But if you do decide to change the naming, then it's ok because all other libs are doing so too.

francoism90 commented 3 years ago

@mkwsra

2018_06_14_000000_create_acquaintances_friendships_groups_table.php
2018_06_14_000000_create_acquaintances_friendship_table.php
2018_06_14_000000_create_acquaintances_interactions_table.php

Looks fine here. :)