RSS Feed/News XF\Db\Schema\Column::values() can generate invalid SQL

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,656
Points
823

Reputation:

Given the example code:
PHP:

Code:
$this->schemaManager()->createTable('test', function(Create $table) {
    $table->addColumn('id','int')->values(null);
});

It will generate the following (invalid) SQL:
SQL:

Code:
  CREATE TABLE `test` (
        `id` INT(NULL) UNSIGNED NOT NULL
);

The issue is XF\Db\Schema\Column::values(), doesn't handle null sanely, and converts it into [null] unlike all the other fluent functions for XF\Db\Schema\Column

SQL:

public function...

Read more

Continue reading...
 
Status
Not open for further replies.
Top