cms/database/migrations/2026_03_15_073335_create_translations_table.php

34 lines
802 B
PHP
Raw Permalink Normal View History

<?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('translations', function (Blueprint $table) {
$table->id();
$table->string('locale')->index();
$table->string('group')->index(); // e.g., 'cms', 'plugins::blog'
$table->string('key')->index();
$table->text('value');
$table->timestamps();
$table->unique(['locale', 'group', 'key']);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('translations');
}
};