43 lines
1.2 KiB
PHP
43 lines
1.2 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();
|
|
$table->string('type_id', 50)->default('vps')->index();
|
|
$table->string('code', 50)->unique();
|
|
$table->string('name', 100);
|
|
$table->string('prefix', 50)->nullable();
|
|
$table->integer('min')->default(0);
|
|
$table->integer('max')->default(0);
|
|
$table->integer('step')->default(1);
|
|
$table->integer('price')->default(0);
|
|
$table->enum('input_type', ['number', 'slider', 'select'])
|
|
->default('number');
|
|
$table->boolean('status')->default(true);
|
|
$table->integer('sort_order')->default(0)->index();
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('product_addon');
|
|
}
|
|
};
|