ctrlpanel/database/migrations/2021_07_09_190453_create_vouchers_table.php
2023-01-05 17:03:31 +00:00

37 lines
837 B
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('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');
}
};