<?php

declare(strict_types=1);

namespace SiteFort\Modules\Scanner\Migrations;

use SiteFort\Core\Database\Migration;
use SiteFort\Modules\Scanner\Repository\FileIndexRepository;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

final class FileIndexSchemaV1 implements Migration {

	public function module_key(): string {
		return 'scanner_file_index';
	}

	public function target_version(): int {
		return 1;
	}

	public function is_applied(): bool {
		return FileIndexRepository::is_schema_current();
	}

	public function apply(): bool {
		FileIndexRepository::ensure_schema();
		return true;
	}
}
