<?php

declare(strict_types=1);

namespace SecurWP\Modules\Scanner\Migrations;

use SecurWP\Core\Database\Migration;
use SecurWP\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;
	}
}
