singlestore-labs / singlestoredb-laravel-driver

The official SingleStore Laravel driver.
https://github.com/singlestore-labs/singlestore-laravel-driver
Apache License 2.0
223 stars 22 forks source link

Using the RefreshDatabase trait errors with dropping multiple tables #19

Closed heychazza closed 2 years ago

heychazza commented 2 years ago

Hi,

When attempting to run a series of tests that involve the RefreshDatabase trait, I am greeted with the following error:

Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1706 Feature 'Dropping more than one table in a single query' is not supported by SingleStore.

This only applies within tests, as manually doing php artisan migrate:fresh doesn't cause this. However my tests all rely on refreshing.

aarondfrancis commented 2 years ago

Hey @heychazza! That's kinda confusing to me, because it looks like the RefreshDatabase trait defers to migrate:fresh under the hood. (https://github.com/laravel/framework/blob/9.x/src/Illuminate/Foundation/Testing/RefreshDatabase.php#L73)

When you're running tests, are you using the SingleStore driver? If your test DB is set up to use the MySQL driver but is pointed at a SingleStore db, you might get that error.

heychazza commented 2 years ago

Hey @heychazza! That's kinda confusing to me, because it looks like the RefreshDatabase trait defers to migrate:fresh under the hood. (https://github.com/laravel/framework/blob/9.x/src/Illuminate/Foundation/Testing/RefreshDatabase.php#L73)

When you're running tests, are you using the SingleStore driver? If your test DB is set up to use the MySQL driver but is pointed at a SingleStore db, you might get that error.

Apologies in the delay, that was a good spot! Always annoying when its that pesky phpunit.xml file with the override.