Skip to content

Problem dropping foreign keys when run tests using in memory sqlite. #23461

Closed
@amirpiri

Description

@amirpiri
  • Laravel Version: 5.3.30
  • PHP Version: 7.1
  • Database Driver & Version: sqlite

Description:

I have an old database that I did not write migrations for it. After a while I decided to write migration not only because I want to write unit tests, but also for development.
But my problems starts when I want to migrates from Laravel 5.2 to Laravel 5.3.
I want to update my jobs table according to the documentation for this purpose, but when I run tests again it produced an error :

`Testing started at 7:07 PM ...
/usr/bin/php7.0 /tmp/ide-phpunit.php --configuration /var/www/html/HomeLine/phpunit.xml
PHPUnit 4.8.36 by Sebastian Bergmann and contributors.

SQLSTATE[HY000]: General error: 1 no such index: jobs_queue_reserved_reserved_at_index (SQL: DROP INDEX jobs_queue_reserved_reserved_at_index)
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Connection.php:770
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Connection.php:726
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Connection.php:481
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:83
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:229
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:130
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:237
/var/www/html/HomeLine/database/migrations/2018_03_09_183625_upgrate_job_table_to_laravel_53.php:20
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:373
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:380
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:162
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:130
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:97
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/MigrateCommand.php:65
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Container/Container.php:508
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Console/Command.php:169
/var/www/html/HomeLine/vendor/symfony/console/Command/Command.php:261
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Console/Command.php:155
/var/www/html/HomeLine/vendor/symfony/console/Application.php:817
/var/www/html/HomeLine/vendor/symfony/console/Application.php:185
/var/www/html/HomeLine/vendor/symfony/console/Application.php:116
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Console/Application.php:107
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:218
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/InteractsWithConsole.php:25
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Foundation/Testing/DatabaseMigrations.php:16
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:105
/var/www/html/HomeLine/vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestCase.php:70
/var/www/html/HomeLine/tests/TestCase.php:31
`

I should mention that everything is OK when I run the migrations with MySql database.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions