DB Migration keeps failing |
Hi everyone,
I am trying to make a simple DB migration, renaming a column in an existing table. I tripled checked my migration file, connection and everything I could think of but I am stuck with an error and have no idea what to do. Can you help me understand where the problem is? My migration: PHP Code: public function up() The error I am getting: Code: An uncaught Exception was encountered
Most likely, there is data in your table that has the value title = NULL.
You cannot change such a column. Delete the found values with NULL or set them as "" (empty string)
Simple CI 4 project for beginners codeigniter-expenses
It seems an SQL syntax error. Check the SQL statement that was executed.
(08-26-2023, 02:14 PM)kenjis Wrote: It seems an SQL syntax error. Check the SQL statement that was executed.How do I do that? Is it somewhere in the logs? Or should I use a different command when I run php spark migrate ? // Edit I am not sure if this is the best way... but I went into the BaseConnection.php file and added log_message('debug', $query); to get the query in the logs. It gives me this: Code: DEBUG - 2023-08-26 22:12:15 --> ALTER TABLE `news`
Oh, add number for varchar length 'constraint' => '100',
Simple CI 4 project for beginners codeigniter-expenses
|
Welcome Guest, Not a member yet? Register Sign In |