<?php

declare(strict_types=1);

namespace SiteFort\Modules\Scanner\Migrations;

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