File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 5
5
namespace MongoDB \Laravel \Schema ;
6
6
7
7
use Illuminate \Database \Connection ;
8
+ use Illuminate \Database \Schema \Blueprint as SchemaBlueprint ;
8
9
use MongoDB \Laravel \Collection ;
9
10
10
11
use function array_flip ;
15
16
use function is_string ;
16
17
use function key ;
17
18
18
- class Blueprint extends \ Illuminate \ Database \ Schema \Blueprint
19
+ class Blueprint extends SchemaBlueprint
19
20
{
20
21
/**
21
22
* The MongoConnection object for this blueprint.
@@ -276,6 +277,14 @@ public function drop()
276
277
$ this ->collection ->drop ();
277
278
}
278
279
280
+ /** @inheritdoc */
281
+ public function renameColumn ($ from , $ to )
282
+ {
283
+ $ this ->collection ->updateMany ([$ from => ['$exists ' => true ]], ['$rename ' => [$ from => $ to ]]);
284
+
285
+ return $ this ;
286
+ }
287
+
279
288
/** @inheritdoc */
280
289
public function addColumn ($ type , $ name , array $ parameters = [])
281
290
{
You can’t perform that action at this time.
0 commit comments