mardi 11 février 2020

Laravel 5.8 error SQLSTATE[HY000]: General error: 1005 uuid

I am using Laravel 5.8 and package "goldspecdigital/laravel-eloquent-uuid" because I need to use UUID4 and here is my migration file:

 public function up()
    {
        Schema::create('images', function (Blueprint $table) {
            $table->bigIncrements('id');
            // $table->timestamps();
            $table->string('path');
            $table->uuid('visit_id');
            $table->foreign('visit_id')->references('id')->on('visits');

        });
    }

I get the following error:

SQLSTATE[HY000]: General error: 1005 Can't create table doctors _pharmacy.images (errno: 150 "Foreign key constraint is incorrectly formed") (SQL: alter table images add constraint images_visit_id_foreign foreign key (visit_id) references visits (id))

How do I solve this?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2OIlq4M
via IFTTT

Aucun commentaire:

Enregistrer un commentaire