Phases 0–18: core meetings, webinar, breakouts, team chat, live streaming, town hall, billing, and Ladill Mail calendar wiring. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?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
|
||||
{
|
||||
// Local mirror of the platform identity, keyed by public_id (OIDC sub).
|
||||
Schema::create('users', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('public_id')->unique();
|
||||
$table->string('name')->nullable();
|
||||
$table->string('email')->unique();
|
||||
$table->string('avatar_url')->nullable();
|
||||
$table->timestamp('email_verified_at')->nullable();
|
||||
$table->string('password')->nullable();
|
||||
$table->rememberToken();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
||||
$table->string('email')->primary();
|
||||
$table->string('token');
|
||||
$table->timestamp('created_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('sessions', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->foreignId('user_id')->nullable()->index();
|
||||
$table->string('ip_address', 45)->nullable();
|
||||
$table->text('user_agent')->nullable();
|
||||
$table->longText('payload');
|
||||
$table->integer('last_activity')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('users');
|
||||
Schema::dropIfExists('password_reset_tokens');
|
||||
Schema::dropIfExists('sessions');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,35 @@
|
||||
<?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('cache', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->mediumText('value');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
|
||||
Schema::create('cache_locks', function (Blueprint $table) {
|
||||
$table->string('key')->primary();
|
||||
$table->string('owner');
|
||||
$table->integer('expiration')->index();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('cache');
|
||||
Schema::dropIfExists('cache_locks');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,57 @@
|
||||
<?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('jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('queue')->index();
|
||||
$table->longText('payload');
|
||||
$table->unsignedTinyInteger('attempts');
|
||||
$table->unsignedInteger('reserved_at')->nullable();
|
||||
$table->unsignedInteger('available_at');
|
||||
$table->unsignedInteger('created_at');
|
||||
});
|
||||
|
||||
Schema::create('job_batches', function (Blueprint $table) {
|
||||
$table->string('id')->primary();
|
||||
$table->string('name');
|
||||
$table->integer('total_jobs');
|
||||
$table->integer('pending_jobs');
|
||||
$table->integer('failed_jobs');
|
||||
$table->longText('failed_job_ids');
|
||||
$table->mediumText('options')->nullable();
|
||||
$table->integer('cancelled_at')->nullable();
|
||||
$table->integer('created_at');
|
||||
$table->integer('finished_at')->nullable();
|
||||
});
|
||||
|
||||
Schema::create('failed_jobs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('uuid')->unique();
|
||||
$table->text('connection');
|
||||
$table->text('queue');
|
||||
$table->longText('payload');
|
||||
$table->longText('exception');
|
||||
$table->timestamp('failed_at')->useCurrent();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('jobs');
|
||||
Schema::dropIfExists('job_batches');
|
||||
Schema::dropIfExists('failed_jobs');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
<?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('notifications', function (Blueprint $table) {
|
||||
$table->uuid('id')->primary();
|
||||
$table->string('type');
|
||||
$table->morphs('notifiable');
|
||||
$table->text('data');
|
||||
$table->timestamp('read_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('notifications');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
/**
|
||||
* Ladill Meet core schema — multi-branch organizations.
|
||||
*
|
||||
* Hierarchy: owner_ref → Organization → Branch → Member
|
||||
*/
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('meet_organizations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->string('name');
|
||||
$table->string('slug')->index();
|
||||
$table->string('logo_path')->nullable();
|
||||
$table->string('timezone')->default('UTC');
|
||||
$table->json('settings')->nullable();
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->unique(['owner_ref', 'slug']);
|
||||
});
|
||||
|
||||
Schema::create('meet_branches', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->string('name');
|
||||
$table->string('code')->nullable();
|
||||
$table->string('address')->nullable();
|
||||
$table->string('phone')->nullable();
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::create('meet_members', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->string('user_ref')->index();
|
||||
$table->string('role');
|
||||
$table->foreignId('branch_id')->nullable()->constrained('meet_branches')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
$table->unique(['organization_id', 'user_ref']);
|
||||
});
|
||||
|
||||
Schema::create('meet_audit_logs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->nullable()->constrained('meet_organizations')->nullOnDelete();
|
||||
$table->string('actor_ref')->nullable();
|
||||
$table->string('action');
|
||||
$table->string('subject_type')->nullable();
|
||||
$table->unsignedBigInteger('subject_id')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->string('ip_address')->nullable();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
$table->index(['owner_ref', 'created_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('meet_audit_logs');
|
||||
Schema::dropIfExists('meet_members');
|
||||
Schema::dropIfExists('meet_branches');
|
||||
Schema::dropIfExists('meet_organizations');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,90 @@
|
||||
<?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('meet_rooms', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->foreignId('branch_id')->nullable()->constrained('meet_branches')->nullOnDelete();
|
||||
$table->string('host_user_ref')->index();
|
||||
$table->string('title');
|
||||
$table->text('description')->nullable();
|
||||
$table->string('type')->default('instant'); // instant, scheduled, personal, recurring
|
||||
$table->string('status')->default('scheduled'); // scheduled, live, ended, cancelled
|
||||
$table->string('slug')->nullable()->index();
|
||||
$table->timestamp('scheduled_at')->nullable()->index();
|
||||
$table->unsignedInteger('duration_minutes')->nullable();
|
||||
$table->string('timezone')->default('UTC');
|
||||
$table->string('passcode')->nullable();
|
||||
$table->json('settings')->nullable();
|
||||
$table->json('source')->nullable(); // {app, entity_type, entity_id}
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
$table->index(['owner_ref', 'status', 'scheduled_at']);
|
||||
});
|
||||
|
||||
Schema::create('meet_sessions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('room_id')->constrained('meet_rooms')->cascadeOnDelete();
|
||||
$table->string('media_room_name')->index();
|
||||
$table->string('status')->default('live'); // live, ended
|
||||
$table->timestamp('started_at')->nullable();
|
||||
$table->timestamp('ended_at')->nullable();
|
||||
$table->unsignedInteger('peak_participants')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_participants', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->string('user_ref')->nullable()->index();
|
||||
$table->string('display_name');
|
||||
$table->string('email')->nullable();
|
||||
$table->string('role')->default('participant'); // host, co_host, participant, guest
|
||||
$table->string('status')->default('invited'); // invited, waiting, joined, left, removed
|
||||
$table->timestamp('joined_at')->nullable();
|
||||
$table->timestamp('left_at')->nullable();
|
||||
$table->string('device_info')->nullable();
|
||||
$table->string('ip_address')->nullable();
|
||||
$table->boolean('hand_raised')->default(false);
|
||||
$table->boolean('is_muted')->default(false);
|
||||
$table->boolean('is_video_off')->default(false);
|
||||
$table->timestamps();
|
||||
$table->index(['session_id', 'status']);
|
||||
});
|
||||
|
||||
Schema::create('meet_invitations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('room_id')->constrained('meet_rooms')->cascadeOnDelete();
|
||||
$table->string('email')->nullable();
|
||||
$table->string('user_ref')->nullable();
|
||||
$table->string('display_name')->nullable();
|
||||
$table->string('role')->default('participant');
|
||||
$table->string('status')->default('pending'); // pending, accepted, declined
|
||||
$table->timestamp('sent_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('meet_invitations');
|
||||
Schema::dropIfExists('meet_participants');
|
||||
Schema::dropIfExists('meet_sessions');
|
||||
Schema::dropIfExists('meet_rooms');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
<?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('meet_messages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->string('sender_ref')->nullable();
|
||||
$table->string('sender_name');
|
||||
$table->string('type')->default('public'); // public, private
|
||||
$table->string('recipient_ref')->nullable();
|
||||
$table->text('body');
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
$table->index(['session_id', 'created_at']);
|
||||
});
|
||||
|
||||
Schema::create('meet_reactions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->string('participant_ref')->nullable();
|
||||
$table->string('sender_name');
|
||||
$table->string('emoji', 32);
|
||||
$table->timestamps();
|
||||
$table->index(['session_id', 'created_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('meet_reactions');
|
||||
Schema::dropIfExists('meet_messages');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,122 @@
|
||||
<?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('meet_recordings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->string('status')->default('recording'); // recording, processing, ready, failed
|
||||
$table->string('layout')->default('gallery');
|
||||
$table->string('storage_path')->nullable();
|
||||
$table->string('thumbnail_path')->nullable();
|
||||
$table->unsignedBigInteger('file_size')->nullable();
|
||||
$table->unsignedInteger('duration_seconds')->nullable();
|
||||
$table->string('started_by_ref')->nullable();
|
||||
$table->timestamp('started_at')->nullable();
|
||||
$table->timestamp('ended_at')->nullable();
|
||||
$table->text('failure_reason')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
$table->index(['owner_ref', 'status']);
|
||||
});
|
||||
|
||||
Schema::create('meet_transcripts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->foreignId('recording_id')->nullable()->constrained('meet_recordings')->nullOnDelete();
|
||||
$table->string('status')->default('pending'); // pending, processing, ready, failed
|
||||
$table->longText('content')->nullable(); // plain searchable text
|
||||
$table->json('segments')->nullable(); // [{speaker, text, start, end}]
|
||||
$table->boolean('live_captions_enabled')->default(false);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_ai_summaries', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->foreignId('transcript_id')->nullable()->constrained('meet_transcripts')->nullOnDelete();
|
||||
$table->string('status')->default('pending'); // pending, processing, ready, failed
|
||||
$table->text('summary')->nullable();
|
||||
$table->json('decisions')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_action_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('ai_summary_id')->constrained('meet_ai_summaries')->cascadeOnDelete();
|
||||
$table->string('assignee_ref')->nullable();
|
||||
$table->string('assignee_name')->nullable();
|
||||
$table->text('description');
|
||||
$table->date('due_date')->nullable();
|
||||
$table->string('status')->default('open'); // open, done, cancelled
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_templates', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
$table->unsignedInteger('duration_minutes')->default(60);
|
||||
$table->json('settings')->nullable();
|
||||
$table->boolean('is_default')->default(false);
|
||||
$table->timestamps();
|
||||
$table->softDeletes();
|
||||
});
|
||||
|
||||
Schema::table('meet_rooms', function (Blueprint $table) {
|
||||
$table->foreignId('template_id')->nullable()->after('source')->constrained('meet_templates')->nullOnDelete();
|
||||
$table->uuid('recurring_series_id')->nullable()->after('template_id')->index();
|
||||
$table->string('recurrence_rule')->nullable()->after('recurring_series_id'); // daily, weekly, monthly
|
||||
$table->unsignedTinyInteger('recurrence_interval')->default(1)->after('recurrence_rule');
|
||||
$table->date('recurrence_until')->nullable()->after('recurrence_interval');
|
||||
});
|
||||
|
||||
Schema::table('meet_sessions', function (Blueprint $table) {
|
||||
$table->boolean('is_locked')->default(false)->after('peak_participants');
|
||||
$table->timestamp('locked_at')->nullable()->after('is_locked');
|
||||
});
|
||||
|
||||
Schema::table('meet_organizations', function (Blueprint $table) {
|
||||
$table->json('security_policy')->nullable()->after('settings');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('meet_organizations', function (Blueprint $table) {
|
||||
$table->dropColumn('security_policy');
|
||||
});
|
||||
|
||||
Schema::table('meet_sessions', function (Blueprint $table) {
|
||||
$table->dropColumn(['is_locked', 'locked_at']);
|
||||
});
|
||||
|
||||
Schema::table('meet_rooms', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('template_id');
|
||||
$table->dropColumn(['recurring_series_id', 'recurrence_rule', 'recurrence_interval', 'recurrence_until']);
|
||||
});
|
||||
|
||||
Schema::dropIfExists('meet_action_items');
|
||||
Schema::dropIfExists('meet_ai_summaries');
|
||||
Schema::dropIfExists('meet_transcripts');
|
||||
Schema::dropIfExists('meet_recordings');
|
||||
Schema::dropIfExists('meet_templates');
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,85 @@
|
||||
<?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('meet_calendar_connections', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->string('user_ref')->index();
|
||||
$table->string('provider'); // google, microsoft, apple
|
||||
$table->text('access_token')->nullable();
|
||||
$table->text('refresh_token')->nullable();
|
||||
$table->timestamp('expires_at')->nullable();
|
||||
$table->string('calendar_id')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
$table->unique(['user_ref', 'provider']);
|
||||
});
|
||||
|
||||
Schema::create('meet_contact_groups', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->string('name');
|
||||
$table->text('description')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_contact_group_members', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('contact_group_id')->constrained('meet_contact_groups')->cascadeOnDelete();
|
||||
$table->string('email')->nullable();
|
||||
$table->string('user_ref')->nullable();
|
||||
$table->string('display_name')->nullable();
|
||||
$table->timestamps();
|
||||
$table->index(['contact_group_id', 'email']);
|
||||
});
|
||||
|
||||
Schema::create('meet_webhook_endpoints', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->string('url');
|
||||
$table->string('secret')->nullable();
|
||||
$table->json('events')->nullable();
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::table('meet_invitations', function (Blueprint $table) {
|
||||
$table->string('rsvp_token')->nullable()->unique()->after('status');
|
||||
$table->timestamp('responded_at')->nullable()->after('rsvp_token');
|
||||
$table->string('calendar_event_id')->nullable()->after('responded_at');
|
||||
});
|
||||
|
||||
Schema::table('meet_rooms', function (Blueprint $table) {
|
||||
$table->string('calendar_event_id')->nullable()->after('source');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('meet_rooms', function (Blueprint $table) {
|
||||
$table->dropColumn('calendar_event_id');
|
||||
});
|
||||
|
||||
Schema::table('meet_invitations', function (Blueprint $table) {
|
||||
$table->dropColumn(['rsvp_token', 'responded_at', 'calendar_event_id']);
|
||||
});
|
||||
|
||||
Schema::dropIfExists('meet_webhook_endpoints');
|
||||
Schema::dropIfExists('meet_contact_group_members');
|
||||
Schema::dropIfExists('meet_contact_groups');
|
||||
Schema::dropIfExists('meet_calendar_connections');
|
||||
}
|
||||
};
|
||||
+157
@@ -0,0 +1,157 @@
|
||||
<?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('meet_webinar_registrations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('room_id')->constrained('meet_rooms')->cascadeOnDelete();
|
||||
$table->string('email');
|
||||
$table->string('display_name');
|
||||
$table->string('status')->default('pending'); // pending, approved, rejected
|
||||
$table->string('access_token')->nullable()->unique();
|
||||
$table->timestamp('approved_at')->nullable();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
$table->unique(['room_id', 'email']);
|
||||
});
|
||||
|
||||
Schema::create('meet_qa_questions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->string('participant_uuid')->nullable();
|
||||
$table->string('asker_name');
|
||||
$table->text('question');
|
||||
$table->string('status')->default('pending'); // pending, approved, answered, dismissed
|
||||
$table->text('answer')->nullable();
|
||||
$table->string('answered_by')->nullable();
|
||||
$table->unsignedInteger('upvotes')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_polls', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->string('question');
|
||||
$table->json('options');
|
||||
$table->string('status')->default('open'); // open, closed
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_poll_votes', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('poll_id')->constrained('meet_polls')->cascadeOnDelete();
|
||||
$table->string('participant_uuid');
|
||||
$table->unsignedTinyInteger('option_index');
|
||||
$table->timestamps();
|
||||
$table->unique(['poll_id', 'participant_uuid']);
|
||||
});
|
||||
|
||||
Schema::create('meet_breakout_rooms', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->string('name');
|
||||
$table->string('media_room_name');
|
||||
$table->string('status')->default('open'); // open, closed
|
||||
$table->timestamp('closes_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_breakout_assignments', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('breakout_room_id')->constrained('meet_breakout_rooms')->cascadeOnDelete();
|
||||
$table->foreignId('participant_id')->constrained('meet_participants')->cascadeOnDelete();
|
||||
$table->timestamps();
|
||||
$table->unique(['breakout_room_id', 'participant_id']);
|
||||
});
|
||||
|
||||
Schema::create('meet_session_files', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('room_id')->constrained('meet_rooms')->cascadeOnDelete();
|
||||
$table->foreignId('session_id')->nullable()->constrained('meet_sessions')->nullOnDelete();
|
||||
$table->string('uploaded_by_ref')->nullable();
|
||||
$table->string('uploaded_by_name');
|
||||
$table->string('original_name');
|
||||
$table->string('storage_path');
|
||||
$table->string('mime_type')->nullable();
|
||||
$table->unsignedBigInteger('file_size')->default(0);
|
||||
$table->string('drive_file_id')->nullable();
|
||||
$table->timestamp('expires_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_file_downloads', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('session_file_id')->constrained('meet_session_files')->cascadeOnDelete();
|
||||
$table->string('downloaded_by_ref')->nullable();
|
||||
$table->string('downloaded_by_name')->nullable();
|
||||
$table->string('ip_address')->nullable();
|
||||
$table->timestamp('downloaded_at');
|
||||
});
|
||||
|
||||
Schema::create('meet_whiteboards', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('room_id')->constrained('meet_rooms')->cascadeOnDelete();
|
||||
$table->foreignId('session_id')->nullable()->constrained('meet_sessions')->nullOnDelete();
|
||||
$table->string('template')->default('blank');
|
||||
$table->json('state')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::table('meet_sessions', function (Blueprint $table) {
|
||||
$table->foreignId('parent_session_id')->nullable()->after('room_id')->constrained('meet_sessions')->nullOnDelete();
|
||||
$table->boolean('is_breakout')->default(false)->after('status');
|
||||
});
|
||||
|
||||
Schema::table('meet_messages', function (Blueprint $table) {
|
||||
$table->foreignId('breakout_room_id')->nullable()->after('session_id')->constrained('meet_breakout_rooms')->nullOnDelete();
|
||||
});
|
||||
|
||||
Schema::table('meet_participants', function (Blueprint $table) {
|
||||
$table->foreignId('breakout_room_id')->nullable()->after('session_id')->constrained('meet_breakout_rooms')->nullOnDelete();
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('meet_participants', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('breakout_room_id');
|
||||
});
|
||||
|
||||
Schema::table('meet_messages', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('breakout_room_id');
|
||||
});
|
||||
|
||||
Schema::table('meet_sessions', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('parent_session_id');
|
||||
$table->dropColumn('is_breakout');
|
||||
});
|
||||
|
||||
Schema::dropIfExists('meet_whiteboards');
|
||||
Schema::dropIfExists('meet_file_downloads');
|
||||
Schema::dropIfExists('meet_session_files');
|
||||
Schema::dropIfExists('meet_breakout_assignments');
|
||||
Schema::dropIfExists('meet_breakout_rooms');
|
||||
Schema::dropIfExists('meet_poll_votes');
|
||||
Schema::dropIfExists('meet_polls');
|
||||
Schema::dropIfExists('meet_qa_questions');
|
||||
Schema::dropIfExists('meet_webinar_registrations');
|
||||
}
|
||||
};
|
||||
+138
@@ -0,0 +1,138 @@
|
||||
<?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('meet_channels', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->foreignId('branch_id')->nullable()->constrained('meet_branches')->nullOnDelete();
|
||||
$table->string('name');
|
||||
$table->string('slug');
|
||||
$table->string('visibility')->default('public'); // public, private
|
||||
$table->text('description')->nullable();
|
||||
$table->timestamps();
|
||||
$table->unique(['organization_id', 'slug']);
|
||||
});
|
||||
|
||||
Schema::create('meet_channel_members', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('channel_id')->constrained('meet_channels')->cascadeOnDelete();
|
||||
$table->string('user_ref')->index();
|
||||
$table->string('role')->default('member'); // admin, moderator, member
|
||||
$table->timestamps();
|
||||
$table->unique(['channel_id', 'user_ref']);
|
||||
});
|
||||
|
||||
Schema::create('meet_channel_messages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('channel_id')->constrained('meet_channels')->cascadeOnDelete();
|
||||
$table->string('sender_ref')->nullable();
|
||||
$table->string('sender_name');
|
||||
$table->text('body');
|
||||
$table->foreignId('parent_id')->nullable()->constrained('meet_channel_messages')->nullOnDelete();
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
$table->index(['channel_id', 'created_at']);
|
||||
});
|
||||
|
||||
Schema::create('meet_direct_conversations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->string('type')->default('dm'); // dm, group
|
||||
$table->string('title')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_direct_participants', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('conversation_id')->constrained('meet_direct_conversations')->cascadeOnDelete();
|
||||
$table->string('user_ref')->index();
|
||||
$table->timestamps();
|
||||
$table->unique(['conversation_id', 'user_ref']);
|
||||
});
|
||||
|
||||
Schema::create('meet_direct_messages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('conversation_id')->constrained('meet_direct_conversations')->cascadeOnDelete();
|
||||
$table->string('sender_ref')->nullable();
|
||||
$table->string('sender_name');
|
||||
$table->text('body');
|
||||
$table->foreignId('parent_id')->nullable()->constrained('meet_direct_messages')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
$table->index(['conversation_id', 'created_at']);
|
||||
});
|
||||
|
||||
Schema::create('meet_live_streams', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->uuid('uuid')->unique();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('session_id')->constrained('meet_sessions')->cascadeOnDelete();
|
||||
$table->string('platform'); // youtube, facebook, linkedin, custom
|
||||
$table->string('rtmp_url');
|
||||
$table->text('stream_key');
|
||||
$table->string('status')->default('idle'); // idle, live, stopped, failed
|
||||
$table->string('layout')->default('speaker');
|
||||
$table->string('health')->nullable();
|
||||
$table->timestamp('started_at')->nullable();
|
||||
$table->timestamp('ended_at')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('meet_usage_records', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('owner_ref')->index();
|
||||
$table->foreignId('organization_id')->constrained('meet_organizations')->cascadeOnDelete();
|
||||
$table->foreignId('branch_id')->nullable()->constrained('meet_branches')->nullOnDelete();
|
||||
$table->string('metric'); // participant_minutes, recording_storage_bytes, ai_minutes
|
||||
$table->unsignedBigInteger('quantity')->default(0);
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamp('recorded_at');
|
||||
$table->timestamps();
|
||||
$table->index(['organization_id', 'metric', 'recorded_at']);
|
||||
});
|
||||
|
||||
Schema::table('meet_organizations', function (Blueprint $table) {
|
||||
$table->string('license_tier')->default('standard')->after('timezone');
|
||||
$table->json('usage_quotas')->nullable()->after('license_tier');
|
||||
});
|
||||
|
||||
Schema::table('meet_sessions', function (Blueprint $table) {
|
||||
$table->string('session_mode')->default('live')->after('status'); // live, green_room, practice
|
||||
$table->json('presenter_refs')->nullable()->after('session_mode');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('meet_sessions', function (Blueprint $table) {
|
||||
$table->dropColumn(['session_mode', 'presenter_refs']);
|
||||
});
|
||||
|
||||
Schema::table('meet_organizations', function (Blueprint $table) {
|
||||
$table->dropColumn(['license_tier', 'usage_quotas']);
|
||||
});
|
||||
|
||||
Schema::dropIfExists('meet_usage_records');
|
||||
Schema::dropIfExists('meet_live_streams');
|
||||
Schema::dropIfExists('meet_direct_messages');
|
||||
Schema::dropIfExists('meet_direct_participants');
|
||||
Schema::dropIfExists('meet_direct_conversations');
|
||||
Schema::dropIfExists('meet_channel_messages');
|
||||
Schema::dropIfExists('meet_channel_members');
|
||||
Schema::dropIfExists('meet_channels');
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user