77use Yiisoft \Db \Constant \ColumnType ;
88use Yiisoft \Db \Constant \PseudoType ;
99use Yiisoft \Db \Exception \NotSupportedException ;
10+ use Yiisoft \Db \Schema \Column \ColumnBuilder ;
1011use Yiisoft \Db \Schema \Column \ColumnInterface ;
1112use Yiisoft \Db \Tests \AbstractCommandTest ;
1213use Yiisoft \Db \Tests \Support \Assert ;
@@ -239,6 +240,7 @@ public function testCreateTable(): void
239240 \t[address] varchar(255) NOT NULL,
240241 \t[status] integer NOT NULL,
241242 \t[profile_id] integer NOT NULL,
243+ \t[data] json CHECK (json_valid([data])),
242244 \t[created_at] timestamp NOT NULL,
243245 \t[updated_at] timestamp NOT NULL
244246 ) CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE=InnoDB
@@ -250,6 +252,7 @@ public function testCreateTable(): void
250252 'address ' => ColumnType::STRING . '(255) NOT NULL ' ,
251253 'status ' => ColumnType::INTEGER . ' NOT NULL ' ,
252254 'profile_id ' => ColumnType::INTEGER . ' NOT NULL ' ,
255+ 'data ' => ColumnBuilder::json (),
253256 'created_at ' => ColumnType::TIMESTAMP . ' NOT NULL ' ,
254257 'updated_at ' => ColumnType::TIMESTAMP . ' NOT NULL ' ,
255258 ];
0 commit comments