Database Migration |
[quote pid="393220" dateline="1642861515"]
After running numerous tests and trying to follow the documentation, I don't believe Migrations will work for me at this time. Not only is it very unclear how to use Migrations (the documentation on the use of UP, DOWN and USE CASE examples using Migratins with a controller), Migrations fail when you try to determine default values for TIMESTAMP. For example, Migratins will fail when running something like: Migrations cannot handle the default values for TIMESTAMP PHP Code: $this->forge->addField([ If I run the following Migrations creates its own Default values. I also tried modify the default values created by Migrations using forge->modifyColumn(), but again Migrations fail when trying to set default values of either CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP() or CURRENT_TIMESTAMP() PHP Code: $this->forge->addField([ Output: Column: update_date, Data type: TIMESTAMP, Default: CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP() Column: create_date, Data type: TIMESTAMP, Default: '0000-00-00 00:00:00' Referencing the MYSQL documentation "TIMESTAMP, CURRENT_TIMESTAMP() ON UPDATE CURRENT_TIMESTAMP() and TIMESTAMP, CURRENT_TIMESTAMP() is allowed in the same table (min ver 5.65), I'm running 5.7. Furthermore, if I run mysql create table quorey directly in workbench or via php script, or create the table via cPanel, absolutely not problem. I'm not sure if Migrations is something new to Ci4, and/or is still under development but unfortunately it lacks in functionality and documentation. [/quote] |
Messages In This Thread |
Database Migration - by 68thorby68 - 01-21-2022, 02:20 PM
RE: Database Migration - by BilltheCat - 01-22-2022, 01:42 AM
RE: Database Migration - by InsiteFX - 01-22-2022, 02:48 AM
RE: Database Migration - by 68thorby68 - 01-22-2022, 04:08 AM
RE: Database Migration - by 68thorby68 - 01-22-2022, 07:29 AM
RE: Database Migration - by iRedds - 01-22-2022, 09:33 AM
RE: Database Migration - by 68thorby68 - 01-27-2022, 03:56 AM
RE: Database Migration - by kenjis - 01-22-2022, 07:59 PM
RE: Database Migration - by kenjis - 01-27-2022, 04:16 AM
RE: Database Migration - by 68thorby68 - 01-27-2022, 04:27 AM
|