<?php

declare(strict_types=1);

namespace SecurWP\Modules\Scanner\Migrations;

use SecurWP\Core\Database\Migration;
use SecurWP\Modules\Scanner\Repository\FileStateRepository;

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

final class FileStateSchemaV1 implements Migration {

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

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

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

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