| 1 |
<?php |
| 2 |
/** |
| 3 |
* Database migration interface |
| 4 |
* |
| 5 |
* @package SeQura/WC |
| 6 |
* @subpackage SeQura/WC/Repositories/Migrations |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace SeQura\WC\Repositories\Migrations; |
| 10 |
|
| 11 |
/** |
| 12 |
* Database migration interface |
| 13 |
*/ |
| 14 |
abstract class Migration { |
| 15 |
|
| 16 |
/** |
| 17 |
* Database session object. |
| 18 |
* |
| 19 |
* @var \wpdb |
| 20 |
*/ |
| 21 |
protected $db; |
| 22 |
|
| 23 |
/** |
| 24 |
* Constructor |
| 25 |
* |
| 26 |
* @param \wpdb $wpdb Database instance. |
| 27 |
*/ |
| 28 |
public function __construct( \wpdb $wpdb ) { |
| 29 |
$this->db = $wpdb; |
| 30 |
} |
| 31 |
|
| 32 |
/** |
| 33 |
* Get the plugin version when the changes were made. |
| 34 |
*/ |
| 35 |
abstract public function get_version(): string; |
| 36 |
|
| 37 |
/** |
| 38 |
* Run the migration. |
| 39 |
* |
| 40 |
* @throws \Throwable |
| 41 |
*/ |
| 42 |
abstract public function run(): void; |
| 43 |
} |
| 44 |
|