Skip to content

Commit

Permalink
Fix rollback migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
lcharette committed Dec 27, 2017
1 parent 57e75c5 commit 762f345
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

## 2.0.9
- Fix rollback migrations.

## 2.0.8
- Fix migrations dependencies for future UF Version.

Expand Down
5 changes: 4 additions & 1 deletion src/Database/Migrations/v201/ProfileFieldsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

use UserFrosting\System\Bakery\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Schema\Builder;
use UserFrosting\Sprinkle\UserProfile\Database\Models\ProfileFields;

/**
* Group profile fields table migration
Expand Down Expand Up @@ -40,6 +40,9 @@ public function up()
*/
public function down()
{
// Delete all group related entries
ProfileFields::where('parent_type', 'UserFrosting\Sprinkle\UserProfile\Database\Models\Group')->delete();

$this->schema->table('profile_fields', function (Blueprint $table) {
$table->foreign('parent_id')->references('id')->on('users');
});
Expand Down

0 comments on commit 762f345

Please sign in to comment.