It all started with the fact that i created new migration
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('a_delivery_pec_pickup_coef', function(Blueprint $table) {
$table->primary(['location_id', 'weight_limit'], 'location_id_weight_limit_index');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('a_delivery_pec_pickup_coef', function(Blueprint $table) {
$table->dropIndex(['location_id_weight_limit_index']);
});
}
After i executed command
php artisan migrate:refresh --seed
and got error
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'delivery_update. a_delivery_pec_delivery_ranges' doesn't exist (SQL: select * from
a_delive ry_pec_delivery_ranges
)
Then something very strange began. I could not execute any commands becouse got same error.
php artisan migrate:rollback
php artisan migrate
php artisan list
application just stopped working. Main page stopped opening. I go into connection.php file and did
error_reporting(E_ALL);
ini_set('display_errors', 1);
Main page show same error, but insead table "a_delivery_pec_delivery_ranges" i saw another table.
Next i created table "a_delivery_pec_delivery_ranges" manually and the error was gone. BUT when i executed
php artisan migrate
i got error
Base table or view already exists: 1050 Table 'a_delivery_ pec_delivery_ranges' already exists
Now I'm in a deadlock situation becouse if i remove table 'a_delivery_ pec_delivery_ranges' my application not working with first error.
But if i add this table (also i tried add migration name into migrations table) and try
php artisan migrate
or
php artisan migrate:rollback
i get 'a_delivery_pec_delivery_ranges' already exists! Also i tried comment "up"-method in this migration
public function up()
{
Schema::create('a_delivery_pec_delivery_ranges', function (Blueprint $table) {
$table->increments('id');
$table->integer('weight');
$table->float('volume');
$table->float('length');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('a_delivery_pec_delivery_ranges');
}
but then i can't create this table!
Also i can't understand why it is this table! I delete each table in turn and and nothing happens. But if i remove this table my application die!
up. Problem is is relevant
php artisan migrate:reset
and thenphp artisan migrate --seed
– teeyoSchema::dropIfExists('a_delivery_pec_delivery_ranges');
in the up method beforeSchema::create ...
and dophp artisan migrate:reset
– Maraboc