48 lines
960 B
PHP
48 lines
960 B
PHP
|
<?php
|
||
|
|
||
|
namespace Nest\Database\Migrations\Configuration;
|
||
|
|
||
|
use Nest\Services\ServiceConfiguration;
|
||
|
use function Nest\Utils\path_join;
|
||
|
|
||
|
/**
|
||
|
* Migrations configuration class.
|
||
|
*/
|
||
|
abstract class MigrationsConfiguration extends ServiceConfiguration
|
||
|
{
|
||
|
/**
|
||
|
* @return string Database migrations PHP namespace.
|
||
|
*/
|
||
|
public abstract function getMigrationsNamespace(): string;
|
||
|
|
||
|
/**
|
||
|
* @return string Database migrations path.
|
||
|
*/
|
||
|
public abstract function getMigrationsPath(): string;
|
||
|
|
||
|
/**
|
||
|
* @return string Database preparations path.
|
||
|
*/
|
||
|
public function getPreparationsPath(): string
|
||
|
{
|
||
|
return path_join($this->getMigrationsPath(), "Prepare");
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Get database to use for migrations table.
|
||
|
* @return string Database identifier.
|
||
|
*/
|
||
|
public function getMigrationsDatabase(): string
|
||
|
{
|
||
|
return "default";
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return string Done migrations table name.
|
||
|
*/
|
||
|
public function getMigrationsTable(): string
|
||
|
{
|
||
|
return "_migrations";
|
||
|
}
|
||
|
}
|