osb/database/migrations/0240-create_checkout.php

49 lines
1.1 KiB
PHP
Raw Permalink Normal View History

2024-06-21 07:43:32 +00:00
<?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('checkouts', function(Blueprint $table)
{
$table->id();
$table->timestamps();
$table->integer('site_id')->unsigned();
$table->boolean('active')->default(false);
$table->string('name',32);
$table->string('description')->nullable();
$table->string('plugin', 32)->nullable();
$table->text('plugin_data')->nullable();
$table->string('graphic_url', 128)->nullable();
$table->float('amount_min', 10, 0)->default(0);
$table->float('amount_max', 10, 0)->nullable();
$table->float('fee_fixed', 10, 0)->nullable();
$table->float('fee_variable', 10, 0)->nullable();
$table->boolean('fee_passon')->default(false);
$table->foreign(['site_id'])->references(['id'])->on('sites');
$table->unique(['id','site_id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::drop('checkouts');
}
};