Welcome Guest, Not a member yet? Register   Sign In
DB Migration keeps failing
#1

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()
    {
        $fields = [
            "title" => [
                "name" => "title_en",
                "type" => "VARCHAR",
                "null" => false,
            ],
        ];
        $this->forge->modifyColumn("news"$fields);
    

The error I am getting:
Code:
An uncaught Exception was encountered

Type:        CodeIgniter\Database\Exceptions\DatabaseException
Message:    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'NOT NULL' at line 2
Filename:    /Users/karine/Dev/ci-test/vendor/codeigniter4/framework/system/Database/BaseConnection.php
Line Number: 646
Any idea what could be going on?
Reply


Messages In This Thread
DB Migration keeps failing - by kcs - 08-26-2023, 11:52 AM
RE: DB Migration keeps failing - by ozornick - 08-26-2023, 12:31 PM
RE: DB Migration keeps failing - by kcs - 08-26-2023, 02:10 PM
RE: DB Migration keeps failing - by kenjis - 08-26-2023, 02:14 PM
RE: DB Migration keeps failing - by kcs - 08-26-2023, 02:23 PM
RE: DB Migration keeps failing - by ozornick - 08-26-2023, 08:45 PM
RE: DB Migration keeps failing - by kcs - 08-27-2023, 12:18 AM



Theme © iAndrew 2016 - Forum software by © MyBB