Lae/database/migrations/2022_08_12_081236_create_drops_table.php

50 lines
1019 B
PHP
Raw Normal View History

2022-08-12 08:51:55 +00:00
<?php
use App\Models\User;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration {
2022-08-12 08:51:55 +00:00
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('drops', function (Blueprint $table) {
$table->id();
// payment
2022-08-12 08:51:55 +00:00
$table->string('payment')->index();
// amount
2022-08-13 09:47:10 +00:00
$table->double('amount', 60, 8)->default(0);
2022-08-12 08:51:55 +00:00
// 汇率
$table->integer('rate')->default(1);
// 实际收入
2022-08-13 09:47:10 +00:00
$table->double('total', 60, 8)->default(0);
2022-08-12 08:51:55 +00:00
$table->boolean('status')->default(0)->index();
$table->foreignIdFor(User::class)->index();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('drops');
}
};