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
2024_12_20_063222_create_tracked_jobs_table ......................................................... 1.87ms FAIL
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 for the right syntax to use near 'after `name`, `attempts` int not null default '1' after `status`, `output` js...' at line 1 (Connection: mariadb, SQL: create table `tracked_jobs` (`id` bigint unsigned not null auto_increment primary key, `trackable_id` varchar(255) null, `trackable_type` varchar(255) null, `name` varchar(255) not null, `status` varchar(255) null, `job_id` varchar(255) null after `name`, `attempts` int not null default '1' after `status`, `output` json null, `started_at` timestamp null, `finished_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:825
821▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
822▕ );
823▕ }
824▕
➜ 825▕ throw new QueryException(
826▕ $this->getName(), $query, $this->prepareBindings($bindings), $e
827▕ );
828▕ }
829▕ }
+9 vendor frames
10 database/migrations/2024_12_20_063222_create_tracked_jobs_table.php:20
Illuminate\Support\Facades\Facade::__callStatic("create")
+26 vendor frames
37 artisan:13
Illuminate\Foundation\Application::handleCommand(Object(Symfony\Component\Console\Input\ArgvInput))
removing ->after(...), from job_id' and attempts does fix the issue:
<?php
declare(strict_types=1);
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
private string $table_name;
private bool $usingUuid;
public function __construct()
{
$this->table_name = config('trackable-jobs.tables.tracked_jobs', 'tracked_jobs');
$this->usingUuid = config('trackable-jobs.using_uuid', false);
}
public function up(): void
{
Schema::create($this->table_name, function (Blueprint $table) {
$this->usingUuid
? $table->uuid()->primary()
: $table->id();
$table->string('trackable_id')->index()->nullable();
$table->string('trackable_type')->index()->nullable();
$table->string('name');
$table->string('status')->nullable();
$table->string('job_id')->nullable();
$table->integer('attempts')->default(1);
$table->json('output')->nullable();
$table->timestamp('started_at')->nullable();
$table->timestamp('finished_at')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists($this->table_name);
}
};
The text was updated successfully, but these errors were encountered:
removing
->after(...)
, fromjob_id'
andattempts
does fix the issue:The text was updated successfully, but these errors were encountered: