mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-21 17:02:19 +00:00
3065b02512
- 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
49 lines
951 B
PHP
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();
|
|
}
|
|
} |