move into sonardesk

This commit is contained in:
Mark Gregory
2026-10-12 14:50:13 +01:00
parent 5f0d2ceb72
commit 38b4a7406f
879 changed files with 24021 additions and 1 deletions
@@ -0,0 +1,96 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up(): void
{
Schema::create('marketplace_publishers', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('slug')->unique();
$table->string('email')->nullable();
$table->string('website')->nullable();
$table->text('public_key')->nullable();
$table->boolean('is_verified')->default(false)->index();
$table->json('metadata')->nullable();
$table->timestamps();
});
Schema::create('marketplace_packages', function (Blueprint $table) {
$table->id();
$table->foreignId('publisher_id')->nullable()->constrained('marketplace_publishers')->nullOnDelete();
$table->string('type', 30)->index();
$table->string('name');
$table->string('slug')->unique();
$table->string('package_name')->unique();
$table->text('description')->nullable();
$table->string('latest_version')->nullable();
$table->string('homepage')->nullable();
$table->string('repository_url')->nullable();
$table->string('download_url')->nullable();
$table->string('checksum', 128)->nullable();
$table->text('signature')->nullable();
$table->json('manifest')->nullable();
$table->boolean('is_featured')->default(false)->index();
$table->boolean('is_active')->default(true)->index();
$table->timestamp('catalogue_updated_at')->nullable();
$table->timestamps();
});
Schema::create('marketplace_installed_packages', function (Blueprint $table) {
$table->id();
$table->foreignId('marketplace_package_id')->nullable()->constrained('marketplace_packages')->nullOnDelete();
$table->string('package_name')->unique();
$table->string('type', 30)->index();
$table->string('version');
$table->string('status', 30)->default('installed')->index();
$table->json('manifest')->nullable();
$table->string('checksum', 128)->nullable();
$table->string('install_path')->nullable();
$table->boolean('is_enabled')->default(true)->index();
$table->foreignId('installed_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('installed_at')->nullable();
$table->timestamp('updated_at_marketplace')->nullable();
$table->timestamps();
});
Schema::create('marketplace_installations', function (Blueprint $table) {
$table->id();
$table->foreignId('installed_package_id')->nullable()->constrained('marketplace_installed_packages')->nullOnDelete();
$table->string('package_name')->index();
$table->string('operation', 30)->index();
$table->string('from_version')->nullable();
$table->string('to_version')->nullable();
$table->string('status', 30)->default('pending')->index();
$table->string('snapshot_path')->nullable();
$table->text('message')->nullable();
$table->json('context')->nullable();
$table->foreignId('performed_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('started_at')->nullable();
$table->timestamp('completed_at')->nullable();
$table->timestamps();
});
Schema::create('marketplace_licences', function (Blueprint $table) {
$table->id();
$table->foreignId('marketplace_package_id')->nullable()->constrained('marketplace_packages')->nullOnDelete();
$table->string('licence_key')->nullable();
$table->string('status', 30)->default('inactive')->index();
$table->string('plan')->nullable();
$table->string('licensed_to')->nullable();
$table->timestamp('activated_at')->nullable();
$table->timestamp('expires_at')->nullable();
$table->json('metadata')->nullable();
$table->timestamps();
});
}
public function down(): void
{
Schema::dropIfExists('marketplace_licences');
Schema::dropIfExists('marketplace_installations');
Schema::dropIfExists('marketplace_installed_packages');
Schema::dropIfExists('marketplace_packages');
Schema::dropIfExists('marketplace_publishers');
}
};