mirror of
https://gh.wpcy.net/https://github.com/fairpm/aspirecloud.git
synced 2026-06-19 02:13:44 +08:00
41 lines
1.1 KiB
PHP
41 lines
1.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
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('packages', function (Blueprint $table) {
|
|
$table->uuid('id')->primary();
|
|
// Identity
|
|
$table->string('did')->nullable();
|
|
$table->text('slug');
|
|
$table->text('name');
|
|
$table->text('description')->nullable();
|
|
// Origin & type
|
|
$table->text('origin');
|
|
$table->text('type');
|
|
$table->text('license');
|
|
// raw data
|
|
$table->jsonb('raw_metadata')->nullable();
|
|
// Timestamps
|
|
$table->timestampTz('created_at')->useCurrent()->index();
|
|
// Constraints
|
|
$table->unique(['did'], 'unique_package_did');
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('packages');
|
|
}
|
|
};
|