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,46 @@
<?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('locales', function (Blueprint $table): void {
$table->id();
$table->string('code', 20)->unique();
$table->string('name', 100);
$table->string('native_name', 100);
$table->string('regional_code', 20)->nullable();
$table->string('direction', 3)->default('ltr');
$table->string('date_format', 40)->default('d/m/Y');
$table->string('time_format', 40)->default('H:i');
$table->string('timezone', 80)->default('UTC');
$table->string('currency_code', 3)->nullable();
$table->string('currency_symbol', 10)->nullable();
$table->unsignedInteger('position')->default(0);
$table->boolean('is_default')->default(false);
$table->boolean('is_active')->default(true);
$table->timestamps();
});
Schema::create('localized_contents', function (Blueprint $table): void {
$table->id();
$table->morphs('translatable');
$table->foreignId('locale_id')->constrained()->cascadeOnDelete();
$table->string('field', 100);
$table->longText('value')->nullable();
$table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamps();
$table->unique(['translatable_type', 'translatable_id', 'locale_id', 'field'], 'localized_content_unique');
$table->index(['locale_id', 'field']);
});
}
public function down(): void
{
Schema::dropIfExists('localized_contents');
Schema::dropIfExists('locales');
}
};