Yii 2: The Fast, Secure and Professional PHP Framework
BSD 3-Clause "New" or "Revised" License
14.24k
stars
6.91k
forks
source link
Altering a timestamp field to remove CURRENT_TIMESTAMP and On Update CURRENT_TIMESTAMP attributes #18586
Open
buttflattery opened 3 years ago
What steps will reproduce the problem?
create a field via migration for the
start
withdefaultExpression()
asCURRENT_TIMESTAMP
andON UPDATE CURRENT_TIMESTAMP
Then try to alter the column to remove the default
current_timestamp
and theon update current_timestamp
using$this->alterColumn($this->_table, 'start', $this->timestamp()->notNull());
What is the expected result?
I expect the column to drop the
default
andextra
attributes for the field but it does not either if i use$this->alterColumn($this->_table, 'start', $this->timestamp()->append('')->notNull());
Additional info