@@ -61,7 +61,7 @@ public function testBluePrint(): void
6161 {
6262 $ instance = $ this ;
6363
64- Schema::collection ('newcollection ' , function ($ collection ) use ($ instance ) {
64+ Schema::table ('newcollection ' , function ($ collection ) use ($ instance ) {
6565 $ instance ->assertInstanceOf (Blueprint::class, $ collection );
6666 });
6767
@@ -72,21 +72,21 @@ public function testBluePrint(): void
7272
7373 public function testIndex (): void
7474 {
75- Schema::collection ('newcollection ' , function ($ collection ) {
75+ Schema::table ('newcollection ' , function ($ collection ) {
7676 $ collection ->index ('mykey1 ' );
7777 });
7878
7979 $ index = $ this ->getIndex ('newcollection ' , 'mykey1 ' );
8080 $ this ->assertEquals (1 , $ index ['key ' ]['mykey1 ' ]);
8181
82- Schema::collection ('newcollection ' , function ($ collection ) {
82+ Schema::table ('newcollection ' , function ($ collection ) {
8383 $ collection ->index (['mykey2 ' ]);
8484 });
8585
8686 $ index = $ this ->getIndex ('newcollection ' , 'mykey2 ' );
8787 $ this ->assertEquals (1 , $ index ['key ' ]['mykey2 ' ]);
8888
89- Schema::collection ('newcollection ' , function ($ collection ) {
89+ Schema::table ('newcollection ' , function ($ collection ) {
9090 $ collection ->string ('mykey3 ' )->index ();
9191 });
9292
@@ -96,7 +96,7 @@ public function testIndex(): void
9696
9797 public function testPrimary (): void
9898 {
99- Schema::collection ('newcollection ' , function ($ collection ) {
99+ Schema::table ('newcollection ' , function ($ collection ) {
100100 $ collection ->string ('mykey ' , 100 )->primary ();
101101 });
102102
@@ -106,7 +106,7 @@ public function testPrimary(): void
106106
107107 public function testUnique (): void
108108 {
109- Schema::collection ('newcollection ' , function ($ collection ) {
109+ Schema::table ('newcollection ' , function ($ collection ) {
110110 $ collection ->unique ('uniquekey ' );
111111 });
112112
@@ -116,58 +116,58 @@ public function testUnique(): void
116116
117117 public function testDropIndex (): void
118118 {
119- Schema::collection ('newcollection ' , function ($ collection ) {
119+ Schema::table ('newcollection ' , function ($ collection ) {
120120 $ collection ->unique ('uniquekey ' );
121121 $ collection ->dropIndex ('uniquekey_1 ' );
122122 });
123123
124124 $ index = $ this ->getIndex ('newcollection ' , 'uniquekey ' );
125125 $ this ->assertEquals (null , $ index );
126126
127- Schema::collection ('newcollection ' , function ($ collection ) {
127+ Schema::table ('newcollection ' , function ($ collection ) {
128128 $ collection ->unique ('uniquekey ' );
129129 $ collection ->dropIndex (['uniquekey ' ]);
130130 });
131131
132132 $ index = $ this ->getIndex ('newcollection ' , 'uniquekey ' );
133133 $ this ->assertEquals (null , $ index );
134134
135- Schema::collection ('newcollection ' , function ($ collection ) {
135+ Schema::table ('newcollection ' , function ($ collection ) {
136136 $ collection ->index (['field_a ' , 'field_b ' ]);
137137 });
138138
139139 $ index = $ this ->getIndex ('newcollection ' , 'field_a_1_field_b_1 ' );
140140 $ this ->assertNotNull ($ index );
141141
142- Schema::collection ('newcollection ' , function ($ collection ) {
142+ Schema::table ('newcollection ' , function ($ collection ) {
143143 $ collection ->dropIndex (['field_a ' , 'field_b ' ]);
144144 });
145145
146146 $ index = $ this ->getIndex ('newcollection ' , 'field_a_1_field_b_1 ' );
147147 $ this ->assertFalse ($ index );
148148
149- Schema::collection ('newcollection ' , function ($ collection ) {
149+ Schema::table ('newcollection ' , function ($ collection ) {
150150 $ collection ->index (['field_a ' => -1 , 'field_b ' => 1 ]);
151151 });
152152
153153 $ index = $ this ->getIndex ('newcollection ' , 'field_a_-1_field_b_1 ' );
154154 $ this ->assertNotNull ($ index );
155155
156- Schema::collection ('newcollection ' , function ($ collection ) {
156+ Schema::table ('newcollection ' , function ($ collection ) {
157157 $ collection ->dropIndex (['field_a ' => -1 , 'field_b ' => 1 ]);
158158 });
159159
160160 $ index = $ this ->getIndex ('newcollection ' , 'field_a_-1_field_b_1 ' );
161161 $ this ->assertFalse ($ index );
162162
163- Schema::collection ('newcollection ' , function ($ collection ) {
163+ Schema::table ('newcollection ' , function ($ collection ) {
164164 $ collection ->index (['field_a ' , 'field_b ' ], 'custom_index_name ' );
165165 });
166166
167167 $ index = $ this ->getIndex ('newcollection ' , 'custom_index_name ' );
168168 $ this ->assertNotNull ($ index );
169169
170- Schema::collection ('newcollection ' , function ($ collection ) {
170+ Schema::table ('newcollection ' , function ($ collection ) {
171171 $ collection ->dropIndex ('custom_index_name ' );
172172 });
173173
@@ -177,44 +177,44 @@ public function testDropIndex(): void
177177
178178 public function testDropIndexIfExists (): void
179179 {
180- Schema::collection ('newcollection ' , function (Blueprint $ collection ) {
180+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
181181 $ collection ->unique ('uniquekey ' );
182182 $ collection ->dropIndexIfExists ('uniquekey_1 ' );
183183 });
184184
185185 $ index = $ this ->getIndex ('newcollection ' , 'uniquekey ' );
186186 $ this ->assertEquals (null , $ index );
187187
188- Schema::collection ('newcollection ' , function (Blueprint $ collection ) {
188+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
189189 $ collection ->unique ('uniquekey ' );
190190 $ collection ->dropIndexIfExists (['uniquekey ' ]);
191191 });
192192
193193 $ index = $ this ->getIndex ('newcollection ' , 'uniquekey ' );
194194 $ this ->assertEquals (null , $ index );
195195
196- Schema::collection ('newcollection ' , function (Blueprint $ collection ) {
196+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
197197 $ collection ->index (['field_a ' , 'field_b ' ]);
198198 });
199199
200200 $ index = $ this ->getIndex ('newcollection ' , 'field_a_1_field_b_1 ' );
201201 $ this ->assertNotNull ($ index );
202202
203- Schema::collection ('newcollection ' , function (Blueprint $ collection ) {
203+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
204204 $ collection ->dropIndexIfExists (['field_a ' , 'field_b ' ]);
205205 });
206206
207207 $ index = $ this ->getIndex ('newcollection ' , 'field_a_1_field_b_1 ' );
208208 $ this ->assertFalse ($ index );
209209
210- Schema::collection ('newcollection ' , function (Blueprint $ collection ) {
210+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
211211 $ collection ->index (['field_a ' , 'field_b ' ], 'custom_index_name ' );
212212 });
213213
214214 $ index = $ this ->getIndex ('newcollection ' , 'custom_index_name ' );
215215 $ this ->assertNotNull ($ index );
216216
217- Schema::collection ('newcollection ' , function (Blueprint $ collection ) {
217+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
218218 $ collection ->dropIndexIfExists ('custom_index_name ' );
219219 });
220220
@@ -226,19 +226,19 @@ public function testHasIndex(): void
226226 {
227227 $ instance = $ this ;
228228
229- Schema::collection ('newcollection ' , function (Blueprint $ collection ) use ($ instance ) {
229+ Schema::table ('newcollection ' , function (Blueprint $ collection ) use ($ instance ) {
230230 $ collection ->index ('myhaskey1 ' );
231231 $ instance ->assertTrue ($ collection ->hasIndex ('myhaskey1_1 ' ));
232232 $ instance ->assertFalse ($ collection ->hasIndex ('myhaskey1 ' ));
233233 });
234234
235- Schema::collection ('newcollection ' , function (Blueprint $ collection ) use ($ instance ) {
235+ Schema::table ('newcollection ' , function (Blueprint $ collection ) use ($ instance ) {
236236 $ collection ->index ('myhaskey2 ' );
237237 $ instance ->assertTrue ($ collection ->hasIndex (['myhaskey2 ' ]));
238238 $ instance ->assertFalse ($ collection ->hasIndex (['myhaskey2_1 ' ]));
239239 });
240240
241- Schema::collection ('newcollection ' , function (Blueprint $ collection ) use ($ instance ) {
241+ Schema::table ('newcollection ' , function (Blueprint $ collection ) use ($ instance ) {
242242 $ collection ->index (['field_a ' , 'field_b ' ]);
243243 $ instance ->assertTrue ($ collection ->hasIndex (['field_a_1_field_b ' ]));
244244 $ instance ->assertFalse ($ collection ->hasIndex (['field_a_1_field_b_1 ' ]));
@@ -247,7 +247,7 @@ public function testHasIndex(): void
247247
248248 public function testBackground (): void
249249 {
250- Schema::collection ('newcollection ' , function ($ collection ) {
250+ Schema::table ('newcollection ' , function ($ collection ) {
251251 $ collection ->background ('backgroundkey ' );
252252 });
253253
@@ -257,7 +257,7 @@ public function testBackground(): void
257257
258258 public function testSparse (): void
259259 {
260- Schema::collection ('newcollection ' , function ($ collection ) {
260+ Schema::table ('newcollection ' , function ($ collection ) {
261261 $ collection ->sparse ('sparsekey ' );
262262 });
263263
@@ -267,7 +267,7 @@ public function testSparse(): void
267267
268268 public function testExpire (): void
269269 {
270- Schema::collection ('newcollection ' , function ($ collection ) {
270+ Schema::table ('newcollection ' , function ($ collection ) {
271271 $ collection ->expire ('expirekey ' , 60 );
272272 });
273273
@@ -277,11 +277,11 @@ public function testExpire(): void
277277
278278 public function testSoftDeletes (): void
279279 {
280- Schema::collection ('newcollection ' , function ($ collection ) {
280+ Schema::table ('newcollection ' , function ($ collection ) {
281281 $ collection ->softDeletes ();
282282 });
283283
284- Schema::collection ('newcollection ' , function ($ collection ) {
284+ Schema::table ('newcollection ' , function ($ collection ) {
285285 $ collection ->string ('email ' )->nullable ()->index ();
286286 });
287287
@@ -291,7 +291,7 @@ public function testSoftDeletes(): void
291291
292292 public function testFluent (): void
293293 {
294- Schema::collection ('newcollection ' , function ($ collection ) {
294+ Schema::table ('newcollection ' , function ($ collection ) {
295295 $ collection ->string ('email ' )->index ();
296296 $ collection ->string ('token ' )->index ();
297297 $ collection ->timestamp ('created_at ' );
@@ -306,7 +306,7 @@ public function testFluent(): void
306306
307307 public function testGeospatial (): void
308308 {
309- Schema::collection ('newcollection ' , function ($ collection ) {
309+ Schema::table ('newcollection ' , function ($ collection ) {
310310 $ collection ->geospatial ('point ' );
311311 $ collection ->geospatial ('area ' , '2d ' );
312312 $ collection ->geospatial ('continent ' , '2dsphere ' );
@@ -324,7 +324,7 @@ public function testGeospatial(): void
324324
325325 public function testDummies (): void
326326 {
327- Schema::collection ('newcollection ' , function ($ collection ) {
327+ Schema::table ('newcollection ' , function ($ collection ) {
328328 $ collection ->boolean ('activated ' )->default (0 );
329329 $ collection ->integer ('user_id ' )->unsigned ();
330330 });
@@ -333,7 +333,7 @@ public function testDummies(): void
333333
334334 public function testSparseUnique (): void
335335 {
336- Schema::collection ('newcollection ' , function ($ collection ) {
336+ Schema::table ('newcollection ' , function ($ collection ) {
337337 $ collection ->sparse_and_unique ('sparseuniquekey ' );
338338 });
339339
@@ -361,7 +361,7 @@ public function testRenameColumn(): void
361361 $ this ->assertArrayNotHasKey ('test ' , $ check [2 ]);
362362 $ this ->assertArrayNotHasKey ('newtest ' , $ check [2 ]);
363363
364- Schema::collection ('newcollection ' , function (Blueprint $ collection ) {
364+ Schema::table ('newcollection ' , function (Blueprint $ collection ) {
365365 $ collection ->renameColumn ('test ' , 'newtest ' );
366366 });
367367
0 commit comments