Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
syncEnrollments
Project
Project
Details
Activity
Releases
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
Yeray Santana Hualde
syncEnrollments
Commits
e2b7d65c
Commit
e2b7d65c
authored
Oct 26, 2012
by
Anahkiasen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added migrate:rebuild command to clean and reconstruct the database
Signed-off-by:
Anahkiasen
<
ehtnam6@gmail.com
>
parent
205cc486
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
2 deletions
+25
-2
migrator.php
laravel/cli/tasks/migrate/migrator.php
+19
-0
migrations.md
laravel/documentation/database/migrations.md
+6
-2
No files found.
laravel/cli/tasks/migrate/migrator.php
View file @
e2b7d65c
...
@@ -139,6 +139,25 @@ class Migrator extends Task {
...
@@ -139,6 +139,25 @@ class Migrator extends Task {
while
(
$this
->
rollback
())
{};
while
(
$this
->
rollback
())
{};
}
}
/**
* Reset the database to pristine state and run all migrations
*
* @param array $arguments
* @return void
*/
public
function
rebuild
()
{
// Clean the database
$this
->
reset
();
echo
PHP_EOL
;
// Re-run all migrations
$this
->
migrate
();
echo
'The database was successfully rebuilt'
.
PHP_EOL
;
}
/**
/**
* Install the database tables used by the migration system.
* Install the database tables used by the migration system.
*
*
...
...
laravel/documentation/database/migrations.md
View file @
e2b7d65c
...
@@ -70,3 +70,7 @@ When you roll back a migration, Laravel rolls back the entire migration "operati
...
@@ -70,3 +70,7 @@ When you roll back a migration, Laravel rolls back the entire migration "operati
**Roll back all migrations that have ever run:**
**Roll back all migrations that have ever run:**
php artisan migrate:reset
php artisan migrate:reset
**Roll back everything and run all migrations again:**
php artisan migrate:rebuild
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