<?php
/**
 * File Path: includes/migrations/class-mbs-migration-2-1.php
 *
 * MBS_Migration_2_1 — Sprint ARC — ARC recipients table
 *
 * Create mbs_arc_recipients table for Advance Review Copy recipient tracking.
 *
 * @package MyBookShowroom
 * @since   3.2.0
 */

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

/**
 * Class MBS_Migration_2_1
 *
 * Create mbs_arc_recipients table for Advance Review Copy recipient tracking.
 *
 * @implements MBS_Migration
 */
class MBS_Migration_2_1 implements MBS_Migration { // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound -- mbs_/MBS_ prefix is correct; scanner not configured with plugin prefix

	/**
	 * {@inheritdoc}
	 *
	 * @return string
	 */
	public function version(): string {
		return '2.1';
	}

	/**
	 * {@inheritdoc}
	 *
	 * Create mbs_arc_recipients table for Advance Review Copy recipient tracking.
	 *
	 * @return void
	 */
	public function up(): void {
		global $wpdb;
		require_once ABSPATH . 'wp-admin/includes/upgrade.php';
		$charset_collate = $wpdb->get_charset_collate();
		dbDelta( MBS_DB_Schema::arc_recipients( $wpdb->prefix . 'mbs_arc_recipients', $charset_collate ) );
	}
}
