43 lines
951 B
PHP
43 lines
951 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.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('tools', function (Blueprint $table) {
|
|
$table->id();
|
|
|
|
$table->string('name');
|
|
$table->string('description')->nullable();
|
|
|
|
$table->string('discovery_url')->index();
|
|
|
|
$table->string('api_key')->nullable();
|
|
|
|
// 数据
|
|
$table->json('data')->nullable();
|
|
|
|
// user id
|
|
$table->unsignedBigInteger('user_id')->index();
|
|
$table->foreign('user_id')->references('id')->on('users');
|
|
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('tools');
|
|
}
|
|
};
|