34 lines
802 B
PHP
34 lines
802 B
PHP
|
|
<?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');
|
||
|
|
}
|
||
|
|
};
|