<?php

declare(strict_types=1);

namespace SiteFort\Modules\Hardening\Migrations;

use SiteFort\Core\Database\Migration;
use SiteFort\Core\Installer;
use SiteFort\Modules\Hardening\LoginAttemptStore;

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

final class LoginAttemptSchemaV1 implements Migration {

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

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

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

	public function apply(): bool {
		Installer::ensure_login_attempts_table_schema();
		return true;
	}
}
