37 lines
845 B
PHP
37 lines
845 B
PHP
|
<?php
|
||
|
|
||
|
use Illuminate\Database\Migrations\Migration;
|
||
|
use Illuminate\Database\Schema\Blueprint;
|
||
|
use Illuminate\Support\Facades\Schema;
|
||
|
|
||
|
class CreateVouchersTable extends Migration
|
||
|
{
|
||
|
/**
|
||
|
* Run the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function up()
|
||
|
{
|
||
|
Schema::create('vouchers', function (Blueprint $table) {
|
||
|
$table->id();
|
||
|
$table->string('code', 36)->unique();
|
||
|
$table->string('memo')->nullable();
|
||
|
$table->unsignedFloat('credits', 10);
|
||
|
$table->unsignedInteger('uses')->default(1);
|
||
|
$table->timestamp('expires_at')->nullable();
|
||
|
$table->timestamps();
|
||
|
});
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Reverse the migrations.
|
||
|
*
|
||
|
* @return void
|
||
|
*/
|
||
|
public function down()
|
||
|
{
|
||
|
Schema::dropIfExists('vouchers');
|
||
|
}
|
||
|
}
|