mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Merge pull request #11083 from joshijitendra/patch-9
MySQL default column type for TimestampBehaviour [skip ci]
This commit is contained in:
@ -29,6 +29,8 @@ use yii\db\BaseActiveRecord;
|
||||
* By default, TimestampBehavior will fill the `created_at` and `updated_at` attributes with the current timestamp
|
||||
* when the associated AR object is being inserted; it will fill the `updated_at` attribute
|
||||
* with the timestamp when the AR object is being updated. The timestamp value is obtained by `time()`.
|
||||
*
|
||||
* For the above implementation to work with MySQL database, please declare the columns(`created_at`, `updated_at`) as int(11) for being UNIX timestamp.
|
||||
*
|
||||
* If your attribute names are different or you want to use a different way of calculating the timestamp,
|
||||
* you may configure the [[createdAtAttribute]], [[updatedAtAttribute]] and [[value]] properties like the following:
|
||||
|
Reference in New Issue
Block a user