feat(domain): chỉnh ngày bắt đầu/hết hạn tên miền và điền hạn từ dữ liệu cũ
PUT administrator/domains/{id}/term, LegacyDomainTerms và migration backfill hạn cho dịch vụ domain chưa có expires_at.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
e37106f2dc
commit
7136bec265
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Service;
|
||||
use App\Support\LegacyDomainTerms;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Service::query()
|
||||
->where('type', 'domain')
|
||||
->whereNull('expires_at')
|
||||
->each(function (Service $service): void {
|
||||
LegacyDomainTerms::fill($service);
|
||||
$service->save();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void {}
|
||||
};
|
||||
Reference in New Issue
Block a user