@@ -67,4 +67,47 @@ public function shard_and_sort_keys()
67
67
'create table `test` (`name` varchar(255) not null, shard key(`name`), sort key(`name`)) '
68
68
);
69
69
}
70
+
71
+ /** @test */
72
+ public function it_adds_a_sort_key_with_with_statement ()
73
+ {
74
+ $ blueprint = $ this ->createTable (function (Blueprint $ table ) {
75
+ $ table ->string ('name ' );
76
+ $ table ->sortKey ('name ' )->with (['columnstore_segment_rows ' => 100000 ]);
77
+ });
78
+
79
+ $ this ->assertCreateStatement (
80
+ $ blueprint ,
81
+ 'create table `test` (`name` varchar(255) not null, sort key(`name`) with (columnstore_segment_rows=100000)) '
82
+ );
83
+ }
84
+
85
+ /** @test */
86
+ public function it_adds_a_sort_key_fluent_with_with_statement ()
87
+ {
88
+ $ blueprint = $ this ->createTable (function (Blueprint $ table ) {
89
+ $ table ->string ('name ' )->sortKey ()->with (['columnstore_segment_rows ' => 100000 ]);
90
+ });
91
+
92
+ $ this ->assertCreateStatement (
93
+ $ blueprint ,
94
+ 'create table `test` (`name` varchar(255) not null, sort key(`name`) with (columnstore_segment_rows=100000)) '
95
+ );
96
+ }
97
+
98
+ /** @test */
99
+ public function it_adds_a_sort_key_fluent_with_dual_with_statement ()
100
+ {
101
+ $ blueprint = $ this ->createTable (function (Blueprint $ table ) {
102
+ $ table ->string ('name ' )->sortKey ()->with ([
103
+ 'columnstore_segment_rows ' => 100000 ,
104
+ 'columnstore_flush_bytes ' => 4194304 ,
105
+ ]);
106
+ });
107
+
108
+ $ this ->assertCreateStatement (
109
+ $ blueprint ,
110
+ 'create table `test` (`name` varchar(255) not null, sort key(`name`) with (columnstore_segment_rows=100000,columnstore_flush_bytes=4194304)) '
111
+ );
112
+ }
70
113
}
0 commit comments