Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-mongodb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
laravel-mongodb
Commits
f12f766d
Unverified
Commit
f12f766d
authored
7 years ago
by
Jens Segers
Committed by
GitHub
7 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1330 from NoelDeMartin/fix-1318
#1318 Implement dropping all tables with mongo driver
parents
5d55933a
8172bfb8
master
develop
4.0.0-alpha.1
v3.6.4
v3.6.3
v3.6.2
v3.6.1
v3.6.0
v3.5.3
v3.5.2
v3.5.1
v3.5.0
v3.4.6
v3.4.5
v3.4.4
v3.4.3
v3.4.2
v3.4.1
v3.4.0
No related merge requests found
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
Builder.php
src/Jenssegers/Mongodb/Schema/Builder.php
+25
-0
No files found.
src/Jenssegers/Mongodb/Schema/Builder.php
View file @
f12f766d
...
...
@@ -106,6 +106,16 @@ class Builder extends \Illuminate\Database\Schema\Builder
return
$blueprint
->
drop
();
}
/**
* @inheritdoc
*/
public
function
dropAllTables
()
{
foreach
(
$this
->
getAllCollections
()
as
$collection
)
{
$this
->
drop
(
$collection
);
}
}
/**
* @inheritdoc
*/
...
...
@@ -113,4 +123,19 @@ class Builder extends \Illuminate\Database\Schema\Builder
{
return
new
Blueprint
(
$this
->
connection
,
$collection
);
}
/**
* Get all of the collections names for the database.
*
* @return array
*/
protected
function
getAllCollections
()
{
$collections
=
[];
foreach
(
$this
->
connection
->
getMongoDB
()
->
listCollections
()
as
$collection
)
{
$collections
[]
=
$collection
->
getName
();
}
return
$collections
;
}
}
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment