DimZ's avatar
Level 4

SQLite : bigInteger migration becomes integer

I'm trying to make it work my tests on SQLite, but I always the same error :

PDOException: SQLSTATE[HY000]: General error: 20 datatype mismatch

I looked at the structure in SQLite, and I noticed that all my bigInteger in my migration files are integer in SQLite.

On MySQL, everything work, but it's slower.

Here are my migration file :

public function up()
    {
        Schema::create('hotels', function (Blueprint $table) {
            $table->bigInteger('id')->unsigned()->primary();
            $table->string('name');
            $table->string('shortname', 4);

            $table->timestamps();
            $table->softDeletes();
        });
    }

BTW I'm on Laravel 5.6.16.

0 likes
1 reply

Please or to participate in this conversation.