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;
|
|
|
|
|
2022-11-16 05:16:56 +00:00
|
|
|
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();
|
|
|
|
|
2022-11-16 05:16:56 +00:00
|
|
|
// 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');
|
|
|
|
}
|
|
|
|
};
|