feat: app

This commit is contained in:
hashbro
2026-09-28 06:12:47 +08:00
parent ad09fdff88
commit e0b06e0d24
14 changed files with 1609 additions and 275 deletions
@@ -0,0 +1,47 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
/**
* Add app_name and bundle_id columns to the channels table.
*
* The "app" builder type (BUILDER_APP) represents an ai-live dylib-injected
* app distribution channel. Each app channel carries the host app identity:
* app_name — e.g. "Ai"
* bundle_id — e.g. "aai.AiAi168168AiAi.app"
* The channel_id for an app channel is a UUID (a13b4f76-…).
*/
return new class extends Migration
{
public function up(): void
{
Schema::table('channels', function (Blueprint $table) {
if (! Schema::hasColumn('channels', 'app_name')) {
$table->string('app_name', 64)->nullable()->after('remark');
}
});
Schema::table('channels', function (Blueprint $table) {
if (! Schema::hasColumn('channels', 'bundle_id')) {
$table->string('bundle_id', 255)->nullable()->after('app_name');
}
});
}
public function down(): void
{
Schema::table('channels', function (Blueprint $table) {
if (Schema::hasColumn('channels', 'bundle_id')) {
$table->dropColumn('bundle_id');
}
});
Schema::table('channels', function (Blueprint $table) {
if (Schema::hasColumn('channels', 'app_name')) {
$table->dropColumn('app_name');
}
});
}
};