Files
FHC-Core/application/migrations/017_bewerbungstermine.php
T
bison 3065b02512 - Added migration script to removing table lehre.tbl_bewerbungsfrist
- Added migration script to adding column studienplan_id and relative foreign key
to table public.tbl_bewerbungstermine
- Changed model Studiengang_model to use the new column in table public.tbl_bewerbungstermine
2016-09-07 12:15:02 +02:00

49 lines
951 B
PHP

<?php
if (! defined("BASEPATH")) exit("No direct script access allowed");
require_once APPPATH . "/libraries/MigrationLib.php";
class Migration_Bewerbungstermine extends MigrationLib
{
public function __construct()
{
parent::__construct();
}
public function up()
{
$this->startUP();
// Add studienplan_id to public.tbl_bewerbungstermine
$columns = array(
"studienplan_id" => array(
"type" => "integer",
"null" => true
)
);
$this->addColumn("public", "tbl_bewerbungstermine", $columns);
$this->addForeingKey(
"public",
"tbl_bewerbungstermine",
"fk_bewerbungstermine_studienplan_id",
"studienplan_id",
"lehre",
"tbl_studienplan",
"studienplan_id",
"ON UPDATE CASCADE ON DELETE RESTRICT"
);
$this->endUP();
}
public function down()
{
$this->startDown();
$this->dropColumn("public", "tbl_bewerbungstermine", "studienplan_id");
$this->endDown();
}
}