mstdmstd's avatar

Are sqlite and my sql 100% compatible in phpunit ?

Hello. Making phpunit tests for laravel 8 app I found error :

Sqlite does not support dropping foreign keys (you would need to recreate the table)

I was raised by line in migration file :

Schema::table('tables', function (Blueprint $table) {
    $table->dropForeign('tables_category_id_foreign');
...

That raised a question are sqlite and my sql 100% compatible in phpunit ?

Laravel Framework 8.83.21
SQLite Library	3.31.1
mysqlnd 8.1.3

In phpunit.xml :

        <server name="CACHE_DRIVER" value="array"/>
        <server name="DB_CONNECTION" value="sqlite"/>
        <server name="DB_DATABASE" value=":memory:"/>

Thanks!

0 likes
2 replies
martinbean's avatar

@mstdmstd What does PHPUnit have to do with anything? SQLite and MySQL aren’t 100% compatible because they’re two different database engines.

1 like

Please or to participate in this conversation.