You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When setting up confide, I generated the migration as explained in the readme.
However, because I already had a users table, with foreign keys, I modified the migration file to add fields, and drop them in the down() method.
I like to test all my migrations in both ways, and when doing so, I discovered the rollback of this migration tries to drop the users table, instead of dropping the columns I specified.
Using a migrate:rollback --verbose, I noticed the rollback is using the file in vendor/zizaco/confide/migrations/ - How can I prevent this behaviour? Is there a reason for this?
[Illuminate\Database\QueryException]
SQLSTATE[23000]: Integrity constraint violation: 1217 Cannot delete or update a parent row: a foreign key constraint fails (SQL: drop table `users`)
Exception trace:
() at vendor/laravel/framework/src/Illuminate/Database/Connection.php:625
Illuminate\Database\Connection->runQueryCallback() at vendor/laravel/framework/src/Illuminate/Database/Connection.php:581
Illuminate\Database\Connection->run() at vendor/laravel/framework/src/Illuminate/Database/Connection.php:370
Illuminate\Database\Connection->statement() at vendor/laravel/framework/src/Illuminate/Database/Schema/Blueprint.php:63
Illuminate\Database\Schema\Blueprint->build() at vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:169
Illuminate\Database\Schema\Builder->build() at vendor/laravel/framework/src/Illuminate/Database/Schema/Builder.php:127
Illuminate\Database\Schema\Builder->drop() at vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:208
Illuminate\Support\Facades\Facade::__callStatic() at vendor/zizaco/confide/src/migrations/2013_01_13_172956_confide_setup_users_table.php:42
Illuminate\Support\Facades\Schema::drop() at vendor/zizaco/confide/src/migrations/2013_01_13_172956_confide_setup_users_table.php:42
ConfideSetupUsersTable->down() at vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:199
Illuminate\Database\Migrations\Migrator->runDown() at vendor/laravel/framework/src/Illuminate/Database/Migrations/Migrator.php:172
Illuminate\Database\Migrations\Migrator->rollback() at vendor/laravel/framework/src/Illuminate/Database/Console/Migrations/RollbackCommand.php:59
Illuminate\Database\Console\Migrations\RollbackCommand->fire() at vendor/laravel/framework/src/Illuminate/Console/Command.php:112
Illuminate\Console\Command->execute() at vendor/symfony/console/Symfony/Component/Console/Command/Command.php:253
Symfony\Component\Console\Command\Command->run() at vendor/laravel/framework/src/Illuminate/Console/Command.php:100
Illuminate\Console\Command->run() at vendor/symfony/console/Symfony/Component/Console/Application.php:889
Symfony\Component\Console\Application->doRunCommand() at vendor/symfony/console/Symfony/Component/Console/Application.php:193
Symfony\Component\Console\Application->doRun() at vendor/symfony/console/Symfony/Component/Console/Application.php:124
Symfony\Component\Console\Application->run() at artisan:59
The text was updated successfully, but these errors were encountered:
ConfideSetupUsersTable assumes that you are creating a new table. If you are not, then you should change the up behavior and also the behavior of down to alter your table back to its previous state.
When setting up confide, I generated the migration as explained in the readme.
However, because I already had a users table, with foreign keys, I modified the migration file to add fields, and drop them in the
down()
method.I like to test all my migrations in both ways, and when doing so, I discovered the rollback of this migration tries to drop the
users
table, instead of dropping the columns I specified.Using a
migrate:rollback --verbose
, I noticed the rollback is using the file invendor/zizaco/confide/migrations/
- How can I prevent this behaviour? Is there a reason for this?The text was updated successfully, but these errors were encountered: