updated table structure for photobooth/sparkbooth settings. now there's a separate table for it. update all references and tests. also fixed the notification panel and the lightbox in the guest app.
This commit is contained in:
47
database/factories/EventPhotoboothSettingFactory.php
Normal file
47
database/factories/EventPhotoboothSettingFactory.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Event;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\EventPhotoboothSetting>
|
||||
*/
|
||||
class EventPhotoboothSettingFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'event_id' => Event::factory(),
|
||||
'enabled' => false,
|
||||
'mode' => 'ftp',
|
||||
'status' => 'inactive',
|
||||
'uploads_last_24h' => 0,
|
||||
'uploads_total' => 0,
|
||||
];
|
||||
}
|
||||
|
||||
public function activeFtp(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'enabled' => true,
|
||||
'mode' => 'ftp',
|
||||
'status' => 'active',
|
||||
]);
|
||||
}
|
||||
|
||||
public function activeSparkbooth(): static
|
||||
{
|
||||
return $this->state(fn () => [
|
||||
'enabled' => true,
|
||||
'mode' => 'sparkbooth',
|
||||
'status' => 'active',
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
<?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::table('events', function (Blueprint $table) {
|
||||
$table->boolean('photobooth_enabled')->default(false)->after('settings');
|
||||
$table->string('photobooth_username', 32)->nullable()->after('photobooth_enabled');
|
||||
$table->text('photobooth_password_encrypted')->nullable()->after('photobooth_username');
|
||||
$table->string('photobooth_path')->nullable()->after('photobooth_password_encrypted');
|
||||
$table->timestamp('photobooth_expires_at')->nullable()->after('photobooth_path');
|
||||
$table->string('photobooth_status', 32)->default('inactive')->after('photobooth_expires_at');
|
||||
$table->timestamp('photobooth_last_provisioned_at')->nullable()->after('photobooth_status');
|
||||
$table->timestamp('photobooth_last_deprovisioned_at')->nullable()->after('photobooth_last_provisioned_at');
|
||||
$table->json('photobooth_metadata')->nullable()->after('photobooth_last_deprovisioned_at');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->dropColumn([
|
||||
'photobooth_enabled',
|
||||
'photobooth_username',
|
||||
'photobooth_password_encrypted',
|
||||
'photobooth_path',
|
||||
'photobooth_expires_at',
|
||||
'photobooth_status',
|
||||
'photobooth_last_provisioned_at',
|
||||
'photobooth_last_deprovisioned_at',
|
||||
'photobooth_metadata',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -16,8 +16,8 @@ return new class extends Migration
|
||||
$table->json('settings')->nullable()->after('max_participants');
|
||||
}
|
||||
|
||||
$table->boolean('watermark_serve_originals')->default(false)->after('photobooth_metadata');
|
||||
$table->json('watermark_settings')->nullable()->after('photobooth_metadata');
|
||||
$table->boolean('watermark_serve_originals')->default(false)->after('settings');
|
||||
$table->json('watermark_settings')->nullable()->after('watermark_serve_originals');
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -1,59 +0,0 @@
|
||||
<?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::table('events', function (Blueprint $table) {
|
||||
$table->string('photobooth_mode', 16)
|
||||
->default('ftp')
|
||||
->after('photobooth_enabled');
|
||||
|
||||
$table->string('sparkbooth_username', 32)
|
||||
->nullable()
|
||||
->after('photobooth_path');
|
||||
$table->text('sparkbooth_password_encrypted')
|
||||
->nullable()
|
||||
->after('sparkbooth_username');
|
||||
$table->timestamp('sparkbooth_expires_at')
|
||||
->nullable()
|
||||
->after('sparkbooth_password_encrypted');
|
||||
$table->string('sparkbooth_status', 32)
|
||||
->default('inactive')
|
||||
->after('sparkbooth_expires_at');
|
||||
$table->timestamp('sparkbooth_last_upload_at')
|
||||
->nullable()
|
||||
->after('sparkbooth_status');
|
||||
$table->unsignedInteger('sparkbooth_uploads_last_24h')
|
||||
->default(0)
|
||||
->after('sparkbooth_last_upload_at');
|
||||
$table->unsignedBigInteger('sparkbooth_uploads_total')
|
||||
->default(0)
|
||||
->after('sparkbooth_uploads_last_24h');
|
||||
|
||||
$table->unique('sparkbooth_username');
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('events', function (Blueprint $table) {
|
||||
$table->dropUnique(['sparkbooth_username']);
|
||||
|
||||
$table->dropColumn([
|
||||
'photobooth_mode',
|
||||
'sparkbooth_username',
|
||||
'sparkbooth_password_encrypted',
|
||||
'sparkbooth_expires_at',
|
||||
'sparkbooth_status',
|
||||
'sparkbooth_last_upload_at',
|
||||
'sparkbooth_uploads_last_24h',
|
||||
'sparkbooth_uploads_total',
|
||||
]);
|
||||
});
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,46 @@
|
||||
<?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('event_photobooth_settings', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('event_id')->constrained()->cascadeOnDelete();
|
||||
$table->boolean('enabled')->default(false);
|
||||
$table->string('mode', 16)->default('ftp');
|
||||
$table->string('username', 32)->nullable();
|
||||
$table->text('password_encrypted')->nullable();
|
||||
$table->string('path')->nullable();
|
||||
$table->string('status', 32)->default('inactive');
|
||||
$table->timestamp('expires_at')->nullable();
|
||||
$table->timestamp('last_provisioned_at')->nullable();
|
||||
$table->timestamp('last_deprovisioned_at')->nullable();
|
||||
$table->timestamp('last_upload_at')->nullable();
|
||||
$table->unsignedInteger('uploads_last_24h')->default(0);
|
||||
$table->unsignedBigInteger('uploads_total')->default(0);
|
||||
$table->json('metadata')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique('event_id');
|
||||
$table->unique('username');
|
||||
$table->index(['enabled', 'expires_at']);
|
||||
$table->index(['enabled', 'path']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('event_photobooth_settings');
|
||||
}
|
||||
};
|
||||
@@ -22,7 +22,7 @@ class DatabaseSeeder extends Seeder
|
||||
EventTypesSeeder::class,
|
||||
EmotionsSeeder::class,
|
||||
TaskCollectionsSeeder::class,
|
||||
InviteLayoutSeeder::class,
|
||||
|
||||
]);
|
||||
|
||||
$this->call([
|
||||
|
||||
17
database/seeders/EventPhotoboothSettingSeeder.php
Normal file
17
database/seeders/EventPhotoboothSettingSeeder.php
Normal file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\EventPhotoboothSetting;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class EventPhotoboothSettingSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
EventPhotoboothSetting::factory()->create();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user