forked from avored/framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added a parent_id into category crud
- Loading branch information
1 parent
557bd38
commit d5aaa1c
Showing
5 changed files
with
65 additions
and
4 deletions.
There are no files selected for viewing
36 changes: 36 additions & 0 deletions
36
database/migrations/2017_03_29_000000_avored_framework_schema_3_1_8.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
use Illuminate\Support\Facades\Schema; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Database\Migrations\Migration; | ||
|
||
class AvoredFrameworkSchema318 extends Migration | ||
{ | ||
/** | ||
* @todo arrange Database Table Creation and foreign keys | ||
* Install the AvoRed Address Module Schema. | ||
* | ||
* @return void | ||
*/ | ||
public function up() | ||
{ | ||
Schema::table('categories', function (Blueprint $table) { | ||
$table->unsignedBigInteger('parent_id')->nullable(); | ||
$table->foreign('parent_id')->references('id')->on('categories'); | ||
}); | ||
|
||
} | ||
|
||
/** | ||
* Uninstall the AvoRed Address Module Schema. | ||
* | ||
* @return void | ||
*/ | ||
public function down() | ||
{ | ||
Schema::table('categories', function (Blueprint $table) { | ||
$table->dropForeign('categories_parent_id_foreign'); | ||
$table->dropColumn('parent_id'); | ||
}); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters