Skip to content

Cannot add foreign key constraint  #80

@moesaid

Description

@moesaid

just got that when importing DB any inside ?

Error
SQL query:

CREATE TABLE  `followables` (

 `user_id` INT( 10 ) UNSIGNED NOT NULL ,
 `followable_id` INT( 10 ) UNSIGNED NOT NULL ,
 `followable_type` VARCHAR( 191 ) COLLATE utf8mb4_unicode_ci NOT NULL ,
 `relation` VARCHAR( 191 ) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT  'follow' COMMENT  'follow/like/subscribe/favorite/upvote/downvote',
 `deleted_at` TIMESTAMP NULL DEFAULT NULL ,
 `created_at` TIMESTAMP NULL DEFAULT NULL ,
 `updated_at` TIMESTAMP NULL DEFAULT NULL ,
KEY  `followables_user_id_foreign` (  `user_id` ) ,
KEY  `followables_followable_type_index` (  `followable_type` ) ,
CONSTRAINT  `followables_user_id_foreign` FOREIGN KEY (  `user_id` ) REFERENCES  `users` (  `id` ) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE = INNODB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_unicode_ci;

MySQL said: Documentation

#1215 - Cannot add foreign key constraint

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions