@@ -360,6 +360,92 @@ public function testTime(): void
360360 $ this ->assertTrue ($ schema ->column ('target ' )->compare ($ column ));
361361 }
362362
363+ public function testUlid (): void
364+ {
365+ $ schema = $ this ->schema ('table ' );
366+ $ this ->assertFalse ($ schema ->exists ());
367+
368+ $ column = $ schema ->ulid ('target ' );
369+
370+ $ schema ->save ();
371+
372+ $ schema = $ this ->schema ('table ' );
373+ $ this ->assertTrue ($ schema ->exists ());
374+ $ this ->assertTrue ($ schema ->column ('target ' )->compare ($ column ));
375+ $ this ->assertSame ('string ' , $ schema ->column ('target ' )->getType ());
376+
377+ $ this ->database ->table ('table ' )->insertOne (
378+ [
379+ 'target ' => '0GWWXY2G84DFMRVWQNJ1SRYCMC ' ,
380+ ],
381+ );
382+
383+ $ this ->assertEquals (
384+ [
385+ 'target ' => '0GWWXY2G84DFMRVWQNJ1SRYCMC ' ,
386+ ],
387+ $ this ->database ->table ('table ' )->select ()->fetchAll ()[0 ],
388+ );
389+ }
390+
391+ public function testUlidCallingColumnMethod (): void
392+ {
393+ $ schema = $ this ->schema ('table ' );
394+ $ this ->assertFalse ($ schema ->exists ());
395+
396+ $ column = $ schema ->column ('target ' )->ulid ();
397+
398+ $ schema ->save ();
399+
400+ $ schema = $ this ->schema ('table ' );
401+ $ this ->assertTrue ($ schema ->exists ());
402+ $ this ->assertTrue ($ schema ->column ('target ' )->compare ($ column ));
403+ $ this ->assertSame ('string ' , $ schema ->column ('target ' )->getType ());
404+
405+ $ this ->database ->table ('table ' )->insertOne (
406+ [
407+ 'target ' => '0GWWXY2G84DFMRVWQNJ1SRYCMC ' ,
408+ ],
409+ );
410+
411+ $ this ->assertEquals (
412+ [
413+ 'target ' => '0GWWXY2G84DFMRVWQNJ1SRYCMC ' ,
414+ ],
415+ $ this ->database ->table ('table ' )->select ()->fetchAll ()[0 ],
416+ );
417+ }
418+
419+ public function testUlidPrimary (): void
420+ {
421+ $ schema = $ this ->schema ('table ' );
422+ $ this ->assertFalse ($ schema ->exists ());
423+
424+ $ column = $ schema ->ulid ('target ' )->nullable (false );
425+ $ schema ->setPrimaryKeys (['target ' ]);
426+ $ schema ->save ();
427+
428+ $ schema = $ this ->schema ('table ' );
429+ $ this ->assertTrue ($ schema ->exists ());
430+
431+ $ this ->assertTrue ($ schema ->column ('target ' )->compare ($ column ));
432+ $ this ->assertSame ('string ' , $ schema ->column ('target ' )->getType ());
433+ $ this ->assertSame (['target ' ], $ schema ->getPrimaryKeys ());
434+
435+ $ this ->database ->table ('table ' )->insertOne (
436+ [
437+ 'target ' => '0GWWXY2G84DFMRVWQNJ1SRYCMC ' ,
438+ ],
439+ );
440+
441+ $ this ->assertEquals (
442+ [
443+ 'target ' => '0GWWXY2G84DFMRVWQNJ1SRYCMC ' ,
444+ ],
445+ $ this ->database ->table ('table ' )->select ()->fetchAll ()[0 ],
446+ );
447+ }
448+
363449 public function testUuid (): void
364450 {
365451 $ schema = $ this ->schema ('table ' );
@@ -388,6 +474,34 @@ public function testUuid(): void
388474 );
389475 }
390476
477+ public function testUuidCallingColumnMethod (): void
478+ {
479+ $ schema = $ this ->schema ('table ' );
480+ $ this ->assertFalse ($ schema ->exists ());
481+
482+ $ column = $ schema ->column ('target ' )->uuid ();
483+
484+ $ schema ->save ();
485+
486+ $ schema = $ this ->schema ('table ' );
487+ $ this ->assertTrue ($ schema ->exists ());
488+ $ this ->assertTrue ($ schema ->column ('target ' )->compare ($ column ));
489+ $ this ->assertSame ('string ' , $ schema ->column ('target ' )->getType ());
490+
491+ $ this ->database ->table ('table ' )->insertOne (
492+ [
493+ 'target ' => 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 ' ,
494+ ],
495+ );
496+
497+ $ this ->assertEquals (
498+ [
499+ 'target ' => 'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11 ' ,
500+ ],
501+ $ this ->database ->table ('table ' )->select ()->fetchAll ()[0 ],
502+ );
503+ }
504+
391505 public function testUuidPrimary (): void
392506 {
393507 $ schema = $ this ->schema ('table ' );
0 commit comments