for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
/**
* Abstract class for all Migrations
*
* @package PinkCrab\Perique\Migration\Plugin_Lifecycle
* @author Glynn Quelch [email protected]
* @since 0.0.1
*/
namespace PinkCrab\Perique\Migration;
use PinkCrab\DB_Migration\Database_Migration;
use PinkCrab\Table_Builder\Schema;
* @method void schema(\PinkCrab\Table_Builder\Schema $schema)
abstract class Migration extends Database_Migration {
* Creates an instance of the migration.
public function __construct() {
$this->table_name = $this->table_name();
$this->schema = new Schema( $this->table_name, array( $this, 'schema' ) );
$this->seed_data = $this->seed( array() );
}
* Must return the table name for the migration.
* @return string
abstract protected function table_name(): string;
* Is this table dropped on deactivation
* Defaults to false.
* @return bool
public function drop_on_deactivation(): bool {
return false;
* Drop table on uninstall.
public function drop_on_uninstall(): bool {
* Should this migration be seeded on activation.
* Defaults to true.
public function seed_on_inital_activation(): bool {
return true;