درود بر دوستان عزیز بنده این ارور درک نمی کنم در مایگریشن
C:\Users\AsemaN\Desktop\laravelpro>php artisan module:migrate discount
Migrating: 2021_07_18_174952_create_discounts_table
   Illuminate\Database\QueryException 
  SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version fo
r the right syntax to use near 'after `user`, `created_at` timestamp null, `updated_at` timestamp null) defau...' at line 1 (SQL: create table `discounts` (`id` bi
gint unsigned not null auto_increment primary key, `code` varchar(255) not null, `percent` int not null, `user` text null, `expired_at` timestamp null after `user`
, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci')
  at C:\Users\AsemaN\Desktop\laravelpro\vendor\laravel\framework\src\Illuminate\Database\Connection.php:678
    674▕         // If an exception occurs when attempting to run a query, we'll format the error
    675▕         // message to include the bindings with SQL, which will make this exception a
    676▕         // lot more helpful to the developer instead of just the database's errors.
    677▕         catch (Exception $e) {
  ➜ 678▕             throw new QueryException(
    679▕                 $query, $this->prepareBindings($bindings), $e
    680▕             );
    681▕         }
    682▕
  1   C:\Users\AsemaN\Desktop\laravelpro\vendor\laravel\framework\src\Illuminate\Database\Connection.php:465
      PDOException::("SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your Maria
DB server version for the right syntax to use near 'after `user`, `created_at` timestamp null, `updated_at` timestamp null) defau...' at line 1")
  2   C:\Users\AsemaN\Desktop\laravelpro\vendor\laravel\framework\src\Illuminate\Database\Connection.php:465
      PDO::prepare("create table `discounts` (`id` bigint unsigned not null auto_increment primary key, `code` varchar(255) not null, `percent` int not null, `user
` text null, `expired_at` timestamp null after `user`, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_uni
code_ci'")
C:\Users\AsemaN\Desktop\laravelpro>php artisan module:migrate discount
Migrating: 2021_07_18_174952_create_discounts_table
Migrated:  2021_07_18_174952_create_discounts_table (21,093.81ms)اینم بخش مایگریشنم
  Schema::create('discount_product', function (Blueprint $table) {
            $table->unsignedBigInteger('discount_id');
            $table->foreign('discount_id')->references('id')->on('discounts')->onDelete('cascade');
            $table->unsignedBigInteger('product_id');
            $table->foreign('product_id')->references('id')->on('products')->onDelete('cascade');
            $table->primary(['discount_id','product_id']);
            $table->timestamps();
        });سلام
@alirezamoghadam3180
این فایل رو باز کنید :
/app/Providers/AppServiceProvider.phpو فانکشن بوت رو این رو داخلش قرار بدید :
    Schema::defaultStringLength(191);و بعد فایل database.php در پوشه config رو باز کنید
/config/database.phpو در داخل قسمت mysql ، این 2 مورد رو پیدا کنید و تغییر بدید به چیزی که در زیر قرار میدم :
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
موردتون رفع خواهد شد.
موفق باشید
سلام
@alirezamoghadam3180
این فایل رو باز کنید :
/app/Providers/AppServiceProvider.phpو فانکشن بوت رو این رو داخلش قرار بدید :
    Schema::defaultStringLength(191);و بعد فایل database.php در پوشه config رو باز کنید
/config/database.phpو در داخل قسمت mysql ، این 2 مورد رو پیدا کنید و تغییر بدید به چیزی که در زیر قرار میدم :
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
موردتون رفع خواهد شد.
موفق باشید
آیا مایل به ارسال نوتیفیکیشن و اخبار از طرف راکت هستید ؟