-
Notifications
You must be signed in to change notification settings - Fork 24
Description
Hi,
I am new to using Phoenix, and have implemented it for some of our systems. We have a field called "updated_at" with a default field of "CURRENT_TIMESTAMP" and an "ON UPDATE" of "CURRENT_TIMESTAMP" aswell. I am getting an error "Setting 'update' is not allowed.".
The code I used was this
$this->table("awards")
->addColumn('id', 'integer', ['autoincrement' => true])
->addColumn('name', 'longtext', ['null' => true])
->addColumn('shortName', 'string', ['null' => true, 'length' => 50])
->addColumn('typeExpiry', 'integer', ['default' => 0])
->addColumn('created_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP'])
->addColumn('updated_at', 'timestamp', ['default' => "CURRENT_TIMESTAMP", 'update' => "CURRENT_TIMESTAMP"])
->addColumn('hidden_at', 'timestamp', ['null' => true])
->create();I also struggled to find out what the option for this even was. I could not find any documentation around the different options that are available for fields. I did however see that this was following Phinx quite closely and assumed that those docs might work. I think if this is supposed to replace phinx, it either should have the docs of what options are supported, or support all of phinx's options and just have a link to their documentation so people don't get lost/confused to what the syntax is etc.
Appreciate any help