Lae/database/migrations/2023_02_02_000001_create_modules_table.php

38 lines
1020 B
PHP
Raw Normal View History

2022-08-13 06:04:47 +00:00
<?php
2022-08-13 08:37:17 +00:00
use Illuminate\Database\Migrations\Migration;
2022-11-06 11:28:22 +00:00
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
2022-08-13 06:04:47 +00:00
2023-01-30 16:14:07 +00:00
return new class extends Migration
{
2022-08-13 06:04:47 +00:00
/**
* Run the migrations.
*
* @return void
*/
2023-01-14 10:02:27 +00:00
public function up(): void
2022-08-13 06:04:47 +00:00
{
Schema::create('modules', function (Blueprint $table) {
2023-02-02 12:11:41 +00:00
$table->string('id')->primary();
2022-08-14 14:00:22 +00:00
$table->string('name')->index();
2023-02-02 12:11:41 +00:00
$table->decimal('balance', 20, 4)->default(0)->index();
$table->string('api_token')->nullable()->unique();
$table->string('url')->nullable()->index();
$table->enum('status', ['up', 'down', 'maintenance'])->default('down')->index();
$table->timestamps();
$table->string('wecom_key')->nullable()->comment('企业微信机器人 key');
2022-08-13 06:04:47 +00:00
});
}
/**
* Reverse the migrations.
*
* @return void
*/
2023-01-14 10:02:27 +00:00
public function down(): void
2022-08-13 06:04:47 +00:00
{
Schema::dropIfExists('modules');
}
};