amber-laravel/database/migrations/2024_07_23_093256_create_tools_table.php

43 lines
942 B
PHP
Raw Normal View History

2024-07-23 15:22:09 +00:00
<?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();
2024-07-23 17:35:03 +00:00
$table->string('discovery_url');
2024-07-23 15:22:09 +00:00
$table->string('api_key')->nullable();
2024-07-23 17:35:03 +00:00
// 数据
$table->json('data')->nullable();
2024-07-23 15:22:09 +00:00
// 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');
}
};