42 lines
1.0 KiB
PHP
42 lines
1.0 KiB
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('product_addon',function (Blueprint $table){
|
|
$table->id()->autoIncrement();
|
|
$table->string('name',100)->nullable();
|
|
$table->integer('price')->nullable();
|
|
$table->integer('min')->nullable();
|
|
$table->integer('max')->nullable();
|
|
$table->integer('step')->nullable();
|
|
$table->string('prefix',50)->nullable();
|
|
$table->integer('type_id')->default(0)->index();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::table('addon',function (Blueprint $table) {
|
|
$table->dropForeign('group_id');
|
|
$table->drop();
|
|
});
|
|
}
|
|
};
|