<?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('translation_dictionaries', function (Blueprint $table) {
            $table->id();
            $table->string('english_term')->unique();
            $table->string('arabic_term');
            $table->enum('type', ['brand', 'product', 'unit', 'packaging', 'flavour', 'size', 'other'])->default('other');
            $table->timestamps();
        });

        Schema::create('translation_caches', function (Blueprint $table) {
            $table->id();
            $table->string('english_text')->unique();
            $table->text('arabic_text');
            $table->timestamps();
        });
    }

    public function down(): void
    {
        Schema::dropIfExists('translation_caches');
        Schema::dropIfExists('translation_dictionaries');
    }
};
