Ben"artisan migrate" kullanıldığında zaman damgası sütun adını nasıl değiştirebilirim?
php artisan migrate
komutu tarafından oluşturulan damgası sütun adlarını değiştirmek için mücadele ediyorum.
Daha önce aşağıdaki değişikliği yaptım. Eloquent sorgu oluşturucu kullandığımda, doğru bir şekilde sütun adı oluşturabilir, ancak yukarıdaki komutu kullandığımda, hala "created_at", "updated_at" ve "deleted_at" üretir. Bana yardım eden var mı? Çok teşekkürler.
/* vendor\framework\src\Illuminate\Database\Eloquent\Model.php */
/**
* The name of the "created at" column.
*
* @var string
*/
const CREATED_AT = 'datetime_created';
/**
* The name of the "updated at" column.
*
* @var string
*/
const UPDATED_AT = 'datetime_updated';
/**
* The name of the "deleted at" column.
*
* @var string
*/
const DELETED_AT = 'datetime_deleted';
/* vendor\framework\src\Illuminate\Database\Schema\Blueprint.php */
/**
* Indicate that the timestamp columns should be dropped.
*
* @return void
*/
public function dropTimestamps()
{
$this->dropColumn('datetime_created', 'datetime_updated');
}
/**
* Add a "deleted at" timestamp for the table.
*
* @return void
*/
public function softDeletes()
{
$this->timestamp('datetime_deleted')->nullable();
}
/**
* Add creation and update timestamps to the table.
*
* @return void
*/
public function timestamps()
{
$this->timestamp('datetime_created');
$this->timestamp('datetime_updated');
}
/**
* Add a "deleted at" timestamp for the table.
*
* @return void
*/
public function softDeletes()
{
$this->timestamp('datetime_deleted')->nullable();
}
Not; "Çekirdek" i değiştirmek için iyi bir fikir olmadığını biliyorum. Birisi bana bu sınıfları genişletmenin en iyi yolunu söyleyebilirse gerçekten takdir ediyorum.
Harika! Cevabınız için çok teşekkürler! Yardımın için sağol. Çalışmamı yaklaşık 8 saat önce bitirdiğimden, yarın evdeki bilgisayarımda yarın deneyebilirim. – Jonathan
Thakns çok şey Raphael! Bu çalışıyor! – Jonathan