refactor: update timestamp fields in multiple migration files to use current timestamps and nullable updates
This commit is contained in:
parent
f545271040
commit
df8ef13552
@ -15,7 +15,8 @@ public function up(): void
|
||||
$table->id();
|
||||
$table->foreignId('broadcast_id')->constrained()->cascadeOnDelete();
|
||||
$table->foreignId('audience_id')->constrained('roles')->cascadeOnDelete();
|
||||
$table->timestamps();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,8 @@ public function up(): void
|
||||
$table->enum('is_show', IsShow::values())->default(IsShow::SHOW)->comment(IsShow::comment());
|
||||
$table->date('start_date');
|
||||
$table->date('end_date')->nullable();
|
||||
$table->timestamps();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
@ -22,7 +22,8 @@ public function up(): void
|
||||
$table->timestamp('expires_at');
|
||||
$table->timestamp('verified_at')->nullable();
|
||||
$table->foreignId('verified_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
||||
$table->softDeletes();
|
||||
});
|
||||
}
|
||||
|
||||
@ -18,7 +18,8 @@ public function up(): void
|
||||
$table->text('content');
|
||||
$table->integer('rating');
|
||||
$table->enum('is_show', IsShow::values())->default(IsShow::SHOW)->comment(IsShow::comment());
|
||||
$table->timestamps();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->timestamp('updated_at')->nullable()->useCurrentOnUpdate();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
// User needs a referral code to display it
|
||||
ReferralCode::factory()->for($this->user)->create([
|
||||
'code' => 'YADI123'
|
||||
'code' => 'YADI123',
|
||||
]);
|
||||
|
||||
Livewire::test(Referral::class)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user