classNullablePrimaryKey
final class NullablePrimaryKey
implements Diagnostic
uses Snapshot
Public API: explicitly declared with
@visibility public.A primary key column declared with the NULL attribute, which MySQL 5.7 and later reject (ER_PRIMARY_CANT_HAVE_NULL); MySQL 5.6 makes the column NOT NULL silently.
Source: https://dev.mysql.com/doc/refman/8.4/en/create-table.html#create-table-indexes-keys.
(new \SqlSemantics\Platform\MySql\Semantics())->analyze('CREATE TABLE t (a INT PRIMARY KEY NULL)') // throws \SqlSemantics\Platform\MySql\Model\Diagnostic\SemanticException: All parts of a PRIMARY KEY must be NOT NULL; column a is declared NULL.Properties§
public Name $columnMethods§
public function message(): stringDescribes the problem in the words of the server.
Returns
stringTest cases 1
Test cases 2§
Test cases that cover or call this symbol, from the coverage report and from the analyzed test sources.