# shiftcontroller/4.9.95/sh4/conf/migration.php

ShiftController Employee Shift Scheduling, version 4.9.95. 52 lines.

- Page: https://pluginprobe.com/plugins/shiftcontroller/4.9.95/code/sh4/conf/migration.php
- Raw: https://pluginprobe.com/plugins/shiftcontroller/4.9.95/raw/sh4/conf/migration.php
- Modified: 2025-12-03T19:39:16+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/shiftcontroller/4.9.95/code/sh4/conf/migration.php#L10-L20`.

```php
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly
class SH4_Conf_Migration
{
	public $dbForge;
	public $migrationService;

	public function __construct(
		HC3_Hooks $hooks,
		HC3_MigrationService $migrationService,
		?HC3_Database_DbForge $dbForge = null
		)
	{
		$this->dbForge = $dbForge;
		$this->migrationService = $migrationService;
	}

	public function up()
	{
		$currentVersion = $this->migrationService->getVersion( 'conf' );

		if( $currentVersion < 1 ){
			$this->version1();
			$this->migrationService->saveVersion( 'conf', 1 );
		}
	}

	public function version1()
	{
		if( $this->dbForge ){
			$this->dbForge->add_field(
				array(
					'id' => array(
						'type' => 'INT',
						'null' => FALSE,
						'unsigned' => TRUE,
						'auto_increment' => TRUE
						),
					'name' => array(
						'type' => 'VARCHAR(255)',
						'null' => FALSE,
						),
					'value' => array(
						'type'		=> 'TEXT',
						'null'		=> TRUE,
						),
					)
				);
			$this->dbForge->add_key('id', TRUE);
			$this->dbForge->create_table('conf');
		}
	}
}
```
