feat: 租戶建立自動產生預設網域與管理員帳號
All checks were successful
Koori-ERP-Deploy-System / deploy-demo (push) Successful in 1m0s
Koori-ERP-Deploy-System / deploy-production (push) Has been skipped

- 修改 TenantController 自動產生預設網域 ({tenant_id}.{TENANT_DEFAULT_DOMAIN})
- 新增 TenantDatabaseSeeder 自動建立 admin 帳號
- 啟用 SeedDatabase Job 在建立租戶時自動執行 seeder
- 新增 TENANT_DEFAULT_DOMAIN 環境變數支援不同環境
- 補充中央資料庫所需的 migrations
This commit is contained in:
2026-01-15 16:55:24 +08:00
parent 287ac6faa3
commit 9bc7c8514b
18 changed files with 452 additions and 25 deletions

View File

@@ -0,0 +1,57 @@
<?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('jobs', function (Blueprint $table) {
$table->id();
$table->string('queue')->index();
$table->longText('payload');
$table->unsignedTinyInteger('attempts');
$table->unsignedInteger('reserved_at')->nullable();
$table->unsignedInteger('available_at');
$table->unsignedInteger('created_at');
});
Schema::create('job_batches', function (Blueprint $table) {
$table->string('id')->primary();
$table->string('name');
$table->integer('total_jobs');
$table->integer('pending_jobs');
$table->integer('failed_jobs');
$table->longText('failed_job_ids');
$table->mediumText('options')->nullable();
$table->integer('cancelled_at')->nullable();
$table->integer('created_at');
$table->integer('finished_at')->nullable();
});
Schema::create('failed_jobs', function (Blueprint $table) {
$table->id();
$table->string('uuid')->unique();
$table->text('connection');
$table->text('queue');
$table->longText('payload');
$table->longText('exception');
$table->timestamp('failed_at')->useCurrent();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('jobs');
Schema::dropIfExists('job_batches');
Schema::dropIfExists('failed_jobs');
}
};