bash-5.1# php artisan migrate
Migrating: 2018_04_18_193554_create_botan_shortener_table
Migrated: 2018_04_18_193554_create_botan_shortener_table (73.51ms)
Migrating: 2018_04_18_193554_create_callback_query_table
Illuminate\Database\QueryException
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "user_id" already exists (SQL: create index "user_id" on "callback_query" ("user_id"))
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:703
699▕ // If an exception occurs when attempting to run a query, we'll format the error
700▕ // message to include the bindings with SQL, which will make this exception a
701▕ // lot more helpful to the developer instead of just the database's errors.
702▕ catch (Exception $e) {
➜ 703▕ throw new QueryException(
704▕ $query, $this->prepareBindings($bindings), $e
705▕ );
706▕ }
707▕ }
+9 vendor frames
10 modules/Bot/database/migrations/2018_04_18_193554_create_callback_query_table.php:22
Illuminate\Support\Facades\Facade::__callStatic("create")
+22 vendor frames
33 artisan:37
Illuminate\Foundation\Console\Kernel::handle(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
Usage of ->index('user_id') function causes this issue. Index should have an unique name or is better to omit index name in this function call. Also there are a lot of ->index('chat_id') usages that also will cause the same trouble.
Cannot run migrations of a fresh database:
Usage of
->index('user_id')
function causes this issue. Index should have an unique name or is better to omit index name in this function call. Also there are a lot of->index('chat_id')
usages that also will cause the same trouble.