<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

return new class extends Migration {
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::table('cooperative_documents', function (Blueprint $table) {
            $table->string('parent_hashkey', 300)->nullable()->after('hashkey');
            $table->integer('version_number')->default(1)->after('parent_hashkey');
            $table->text('revision_note')->nullable()->after('document_type');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::table('cooperative_documents', function (Blueprint $table) {
            $table->dropColumn(['parent_hashkey', 'version_number', 'revision_note']);
        });
    }
};
