Open dltmthilina opened 1 year ago
migration file
<?php
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema;
return new class extends Migration { /**
Run the migrations. */ public function up(): void { Schema::create('download_counts', function (Blueprint $table) { $table->id(); $table->string('username'); $table->integer('click_count')->default(0); $table->timestamps(); }); }
/**
Warning: Module "fileinfo" is already loaded in Unknown on line 0
INFO Running migrations.
2019_12_14_000001_create_personal_access_tokens_table ............ 5ms FAIL
Illuminate\Database\QueryException
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'personal_access_tokens' already exists (Connection: mysql, SQL: create table
personal_access_tokens
(id
bigint unsigned not null auto_increment primary key,tokenable_type
varchar(255) not null,tokenable_id
bigint unsigned not null,name
varchar(255) not null,token
varchar(64) not null,abilities
text null,last_used_at
timestamp null,expires_at
timestamp null,created_at
timestamp null,updated_at
timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')at vendor\laravel\framework\src\Illuminate\Database\Connection.php:793
789▕ // If an exception occurs when attempting to run a query, we'll format the error 790▕ // message to include the bindings with SQL, which will make this exception a 791▕ // lot more helpful to the developer instead of just the database's errors. 792▕ catch (Exception $e) { ➜ 793▕ throw new QueryException( 794▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
795▕ ); 796▕ } 797▕ }
1 vendor\laravel\framework\src\Illuminate\Database\Connection.php:578 PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'personal_access_tokens' already exists")
2 vendor\laravel\framework\src\Illuminate\Database\Connection.php:578 PDOStatement::execute()
PS E:\E-green\14.laravel\myApp> php artisan migrate PHP Warning: Module "fileinfo" is already loaded in Unknown on line 0
Warning: Module "fileinfo" is already loaded in Unknown on line 0
INFO Preparing database.
Creating migration table ................................................... 64ms DONE
INFO Running migrations.
2019_12_14_000001_create_personal_access_tokens_table ..................... 106ms FAIL
Illuminate\Database\QueryException
SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes (Connection: mysql, SQL: alter table
personal_access_tokens
add indexpersonal_access_tokens_tokenable_type_tokenable_id_index
(tokenable_type
,tokenable_id
))at vendor\laravel\framework\src\Illuminate\Database\Connection.php:793 789▕ // If an exception occurs when attempting to run a query, we'll format the error 790▕ // message to include the bindings with SQL, which will make this exception a 791▕ // lot more helpful to the developer instead of just the database's errors. 792▕ catch (Exception $e) { ➜ 793▕ throw new QueryException( 794▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
795▕ ); 797▕ }
1 vendor\laravel\framework\src\Illuminate\Database\Connection.php:578 PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes")
2 vendor\laravel\framework\src\Illuminate\Database\Connection.php:578 PDOStatement::execute()