mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Improved MigrationLib
- Improved migration script 011_reihungstest - Added migration script 012_bewerbungsfrist
This commit is contained in:
@@ -74,6 +74,16 @@ class MigrationLib extends CI_Migration
|
||||
$this->printInfo(sprintf("%s End method up of class %s %s", $this->SEPARATOR, get_called_class(), $this->SEPARATOR));
|
||||
}
|
||||
|
||||
protected function startDown()
|
||||
{
|
||||
$this->printInfo(sprintf("%s Start method down of class %s %s", $this->SEPARATOR, get_called_class(), $this->SEPARATOR));
|
||||
}
|
||||
|
||||
protected function endDown()
|
||||
{
|
||||
$this->printInfo(sprintf("%s End method down of class %s %s", $this->SEPARATOR, get_called_class(), $this->SEPARATOR));
|
||||
}
|
||||
|
||||
protected function addColumn($schema, $table, $fields)
|
||||
{
|
||||
foreach($fields as $name => $definition)
|
||||
@@ -96,6 +106,25 @@ class MigrationLib extends CI_Migration
|
||||
}
|
||||
}
|
||||
|
||||
protected function dropColumn($schema, $table, $field)
|
||||
{
|
||||
if ($this->columnExists($field, $schema, $table))
|
||||
{
|
||||
if ($this->dbforge->drop_column($schema . '.' . $table, $field))
|
||||
{
|
||||
$this->printMessage(sprintf("Column %s.%s.%s has been dropped", $schema, $table, $field));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->printError(sprintf("Error while dropping column %s.%s.%s", $schema, $table, $field));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->printInfo(sprintf("Column %s.%s.%s doesn't exist", $schema, $table, $field));
|
||||
}
|
||||
}
|
||||
|
||||
protected function addPrimaryKey($schema, $table, $name, $fields)
|
||||
{
|
||||
$stringFields = null;
|
||||
@@ -207,6 +236,18 @@ class MigrationLib extends CI_Migration
|
||||
}
|
||||
}
|
||||
|
||||
protected function dropTable($schema, $table)
|
||||
{
|
||||
if ($this->dbforge->drop_table($schema . "." . $table))
|
||||
{
|
||||
$this->printMessage(sprintf("Table %s.%s has been dropped", $schema, $table));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->printError(sprintf("Dropping table %s.%s", $schema, $table));
|
||||
}
|
||||
}
|
||||
|
||||
protected function execQuery($query)
|
||||
{
|
||||
if (! @$this->db->simple_query($query))
|
||||
|
||||
Reference in New Issue
Block a user