Welcome Guest, Not a member yet? Register   Sign In
On Update Database Forge Fields
#1

Is it possible to specify the 'on update' section of a new field like the below snippet? Or this something that can be considered for CI4?

I know I can create the field manually, but it looks a lot cleaner like this, especially for developer on-boarding.

PHP Code:
$this->forge->addFields([
    
'field_name' => [
        
'type' => 'DATETIME',
        
'default' => 'CURRENT_TIMESTAMP',
        
'update' => 'CURRENT_TIMESTAMP'
    
]
]);
$this->forge->createTable('table_name'); 
Kristian Matthews-Kennington
Apple Certified Associate Mac Integration & Management 10.10
Reply
#2

That's an interesting feature request. I'd have to see how it scales across the different platforms that we plan to support to see how feasible it is, though.
Reply
#3

(01-01-2017, 08:46 PM)kilishan Wrote: That's an interesting feature request. I'd have to see how it scales across the different platforms that we plan to support to see how feasible it is, though.

If it is feasible I'd be happy to create a pull request.
Kristian Matthews-Kennington
Apple Certified Associate Mac Integration & Management 10.10
Reply




Theme © iAndrew 2016 - Forum software by © MyBB