mirror of https://github.com/4xmen/xshop.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.2 KiB
PHTML
43 lines
1.2 KiB
PHTML
5 months ago
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
return new class extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*/
|
||
|
public function up(): void
|
||
|
{
|
||
3 months ago
|
Schema::create('items', function (Blueprint $table) {
|
||
5 months ago
|
$table->id();
|
||
|
$table->text('title');
|
||
|
// $table->morphs('menuable')->nullable();;
|
||
|
$table->unsignedBigInteger('menuable_id')->nullable();
|
||
|
$table->string('menuable_type')->nullable();
|
||
|
$table->string('kind')->nullable();
|
||
|
$table->text('meta')->nullable();
|
||
|
$table->unsignedInteger('parent')->nullable()->default(null)->index();
|
||
|
$table->unsignedInteger('sort')->default(0);
|
||
|
$table->unsignedBigInteger('user_id');
|
||
|
$table->unsignedBigInteger('menu_id');
|
||
|
$table->timestamps();
|
||
|
|
||
|
$table->foreign('user_id')
|
||
|
->references('id')->on('users');
|
||
|
$table->foreign('menu_id')
|
||
|
->references('id')->on('menus');
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*/
|
||
|
public function down(): void
|
||
|
{
|
||
3 months ago
|
Schema::dropIfExists('items');
|
||
5 months ago
|
}
|
||
|
};
|