• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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
Apple Certified Associate Mac Integration & Management 10.10
epickris.com
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.
Practical CodeIgniter 3  • CodeIgniter 4 Foundations - Coming Soon • Vulcan - CLI Tools for CI4
Reply

#3
(01-01-2017, 09: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
Apple Certified Associate Mac Integration & Management 10.10
epickris.com
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


Users browsing this thread:
1 Guest(s)


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2017 MyBB Group.