Skip to content

Commit f87ac10

Browse files
committed
added information about usage notnull option
1 parent 77222ad commit f87ac10

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,12 @@ $newTable = $toSchema->createTable('new_table');
7878

7979
// add columns
8080
$newTable->addColumn('id', 'integer', ['unsigned' => true]);
81-
$newTable->addColumn('payload', 'string');
81+
$newTable->addColumn('payload', 'string', ['notnull' => false]);
82+
// *option 'notnull' in false mode allows you to insert NULL into the column;
83+
// in this case, the column will be represented in the ClickHouse as Nullable(String)
8284
$newTable->addColumn('hash', 'string', ['length' => 32, 'fixed' => true]);
83-
// *option 'fixed' sets the fixed length of a string column as specified; if specified, the type of the column is FixedString
85+
// *option 'fixed' sets the fixed length of a string column as specified;
86+
// if specified, the type of the column is FixedString
8487

8588
//set primary key
8689
$newTable->setPrimaryKey(['id']);

0 commit comments

Comments
 (0)