mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-19 13:09:27 +00:00
removed migration files that where moved to checksystem
This commit is contained in:
@@ -1,294 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
require_once APPPATH . "/libraries/MigrationLib.php";
|
||||
|
||||
class Migration_Message extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Create table public.tbl_msg_message
|
||||
$fields = array(
|
||||
"message_id" => array(
|
||||
"type" => "serial"
|
||||
),
|
||||
"person_id" => array(
|
||||
"type" => "bigint"
|
||||
),
|
||||
"subject" => array(
|
||||
"type" => "varchar(256)",
|
||||
"null" => false
|
||||
),
|
||||
"body" => array(
|
||||
"type" => "text",
|
||||
"null" => false
|
||||
),
|
||||
"priority" => array(
|
||||
"type" => "smallint DEFAULT 0",
|
||||
"null" => false
|
||||
),
|
||||
"relationmessage_id" => array(
|
||||
"type" => "bigint",
|
||||
"null" => true
|
||||
),
|
||||
"oe_kurzbz" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
),
|
||||
"insertamum" => array(
|
||||
"type" => "timestamp DEFAULT NOW()",
|
||||
"null" => false
|
||||
),
|
||||
"insertvon" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->createTable("public", "tbl_msg_message", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"public",
|
||||
"tbl_msg_message",
|
||||
"pk_tbl_msg_message",
|
||||
array("message_id")
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_msg_message",
|
||||
"fk_tbl_msg_message_person_id",
|
||||
"person_id",
|
||||
"public",
|
||||
"tbl_person",
|
||||
"person_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_msg_message",
|
||||
"fk_tbl_msg_message_relationmessage_id",
|
||||
"relationmessage_id",
|
||||
"public",
|
||||
"tbl_msg_message",
|
||||
"message_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_msg_message",
|
||||
"fk_tbl_msg_message_oe_kurzbz",
|
||||
"oe_kurzbz",
|
||||
"public",
|
||||
"tbl_organisationseinheit",
|
||||
"oe_kurzbz",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addCommentToColumn("public", "tbl_msg_message", "person_id", "Sender");
|
||||
$this->addCommentToColumn("public", "tbl_msg_message", "priority", "Codex in config/message.php");
|
||||
$this->grantTable("SELECT", "public", "tbl_msg_message", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_msg_message", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_msg_message", "vilesci");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "public", "tbl_msg_message_message_id_seq", "web");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "public", "tbl_msg_message_message_id_seq", "admin");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "public", "tbl_msg_message_message_id_seq", "vilesci");
|
||||
|
||||
// Create table public.tbl_msg_recipient
|
||||
$fields = array(
|
||||
"message_id" => array(
|
||||
"type" => "bigint",
|
||||
"null" => false
|
||||
),
|
||||
"person_id" => array(
|
||||
"type" => "bigint",
|
||||
"null" => false
|
||||
),
|
||||
"token" => array(
|
||||
"type" => "varchar(128)",
|
||||
"null" => true
|
||||
),
|
||||
"sent" => array(
|
||||
"type" => "timestamp DEFAULT NULL",
|
||||
"null" => true
|
||||
),
|
||||
"sentinfo" => array(
|
||||
"type" => "text DEFAULT NULL",
|
||||
"null" => true
|
||||
),
|
||||
"insertamum" => array(
|
||||
"type" => "timestamp DEFAULT NOW()",
|
||||
"null" => false
|
||||
),
|
||||
"insertvon" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->createTable("public", "tbl_msg_recipient", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"public",
|
||||
"tbl_msg_recipient",
|
||||
"pk_tbl_msg_recipient",
|
||||
array("person_id", "message_id")
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_msg_recipient",
|
||||
"fk_tbl_msg_recipient_person_id",
|
||||
"person_id",
|
||||
"public",
|
||||
"tbl_person",
|
||||
"person_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_msg_recipient",
|
||||
"fk_tbl_msg_recipient_message_id",
|
||||
"message_id",
|
||||
"public",
|
||||
"tbl_msg_message",
|
||||
"message_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addUniqueKey(
|
||||
"public",
|
||||
"tbl_msg_recipient",
|
||||
"uk_tbl_msg_recipient_token",
|
||||
array("token")
|
||||
);
|
||||
$this->addCommentToColumn("public", "tbl_msg_recipient", "person_id", "Receiver");
|
||||
$this->addCommentToColumn("public", "tbl_msg_recipient", "sent", "If NULL not sent, otherwise the shipping date");
|
||||
$this->grantTable("SELECT", "public", "tbl_msg_recipient", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_msg_recipient", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_msg_recipient", "vilesci");
|
||||
|
||||
// Create table public.tbl_msg_status
|
||||
$fields = array(
|
||||
"message_id" => array(
|
||||
"type" => "bigint",
|
||||
"null" => false
|
||||
),
|
||||
"person_id" => array(
|
||||
"type" => "bigint",
|
||||
"null" => false
|
||||
),
|
||||
"status" => array(
|
||||
"type" => "smallint",
|
||||
"null" => false
|
||||
),
|
||||
"statusinfo" => array(
|
||||
"type" => "text",
|
||||
"null" => true
|
||||
),
|
||||
"insertamum" => array(
|
||||
"type" => "timestamp DEFAULT NOW()",
|
||||
"null" => false
|
||||
),
|
||||
"insertvon" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
),
|
||||
"updateamum" => array(
|
||||
"type" => "timestamp DEFAULT NOW()",
|
||||
"null" => false
|
||||
),
|
||||
"updatevon" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->createTable("public", "tbl_msg_status", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"public",
|
||||
"tbl_msg_status",
|
||||
"pk_tbl_msg_status",
|
||||
array("message_id", "person_id", "status")
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_msg_status",
|
||||
"fk_tbl_msg_status_person_id",
|
||||
"person_id",
|
||||
"public",
|
||||
"tbl_person",
|
||||
"person_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_msg_status",
|
||||
"fk_tbl_msg_status_message_id",
|
||||
"message_id",
|
||||
"public",
|
||||
"tbl_msg_message",
|
||||
"message_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addCommentToColumn("public", "tbl_msg_status", "person_id", "Receiver");
|
||||
$this->grantTable("SELECT", "public", "tbl_msg_status", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_msg_status", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_msg_status", "vilesci");
|
||||
|
||||
// Create table public.tbl_msg_attachment
|
||||
$fields = array(
|
||||
"attachment_id" => array(
|
||||
"type" => "serial"
|
||||
),
|
||||
"message_id" => array(
|
||||
"type" => "bigint",
|
||||
"null" => false
|
||||
),
|
||||
"name" => array(
|
||||
"type" => "text",
|
||||
"null" => true
|
||||
),
|
||||
"filename" => array(
|
||||
"type" => "text",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->createTable("public", "tbl_msg_attachment", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"public",
|
||||
"tbl_msg_attachment",
|
||||
"pk_tbl_msg_attachment",
|
||||
array("attachment_id")
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_msg_attachment",
|
||||
"fk_tbl_msg_attachment_message_id",
|
||||
"message_id",
|
||||
"public",
|
||||
"tbl_msg_message",
|
||||
"message_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->grantTable("SELECT", "public", "tbl_msg_attachment", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_msg_attachment", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_msg_attachment", "vilesci");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "public", "tbl_msg_attachment_attachment_id_seq", "web");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "public", "tbl_msg_attachment_attachment_id_seq", "admin");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "public", "tbl_msg_attachment_attachment_id_seq", "vilesci");
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropTable("public", "tbl_msg_recipient");
|
||||
$this->dropTable("public", "tbl_msg_status");
|
||||
$this->dropTable("public", "tbl_msg_attachment");
|
||||
$this->dropTable("public", "tbl_msg_message");
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,136 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
require_once APPPATH . "/libraries/MigrationLib.php";
|
||||
|
||||
class Migration_Phrase extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Create table system.tbl_app
|
||||
$fields = array(
|
||||
"app" => array(
|
||||
"type" => "varchar(32)"
|
||||
)
|
||||
);
|
||||
$this->createTable("system", "tbl_app", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"system",
|
||||
"tbl_app",
|
||||
"pk_tbl_app",
|
||||
array("app")
|
||||
);
|
||||
$this->grantTable("SELECT", "system", "tbl_app", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "system", "tbl_app", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "system", "tbl_app", "vilesci");
|
||||
|
||||
// Create table system.tbl_phrase
|
||||
$fields = array(
|
||||
"phrase_id" => array(
|
||||
"type" => "serial"
|
||||
),
|
||||
"app" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => false
|
||||
),
|
||||
"phrase" => array(
|
||||
"type" => "varchar(64)",
|
||||
"null" => false
|
||||
),
|
||||
"insertamum" => array(
|
||||
"type" => "timestamp DEFAULT CURRENT_TIMESTAMP",
|
||||
"null" => false
|
||||
),
|
||||
"insertvon" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->createTable("system", "tbl_phrase", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"system",
|
||||
"tbl_phrase",
|
||||
"pk_tbl_phrase",
|
||||
array("phrase_id")
|
||||
);
|
||||
$this->grantTable("SELECT", "system", "tbl_phrase", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "system", "tbl_phrase", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "system", "tbl_phrase", "vilesci");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "system", "tbl_phrase_phrase_id_seq", "web");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "system", "tbl_phrase_phrase_id_seq", "admin");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "system", "tbl_phrase_phrase_id_seq", "vilesci");
|
||||
|
||||
// Create table system.tbl_phrasentext
|
||||
$fields = array(
|
||||
"phrasentext_id" => array(
|
||||
"type" => "serial"
|
||||
),
|
||||
"phrase_id" => array(
|
||||
"type" => "bigint",
|
||||
"null" => false
|
||||
),
|
||||
"sprache" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => false
|
||||
),
|
||||
"orgeinheit_kurzbz" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
),
|
||||
"orgform_kurzbz" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
),
|
||||
"text" => array(
|
||||
"type" => "text",
|
||||
"null" => true
|
||||
),
|
||||
"description" => array(
|
||||
"type" => "text",
|
||||
"null" => true
|
||||
),
|
||||
"insertamum" => array(
|
||||
"type" => "timestamp DEFAULT CURRENT_TIMESTAMP",
|
||||
"null" => false
|
||||
),
|
||||
"insertvon" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->createTable("system", "tbl_phrasentext", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"system",
|
||||
"tbl_phrasentext",
|
||||
"pk_tbl_phrasentext",
|
||||
array("phrasentext_id")
|
||||
);
|
||||
$this->grantTable("SELECT", "system", "tbl_phrasentext", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "system", "tbl_phrasentext", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "system", "tbl_phrasentext", "vilesci");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "system", "tbl_phrasentext_phrasentext_id_seq", "web");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "system", "tbl_phrasentext_phrasentext_id_seq", "admin");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "system", "tbl_phrasentext_phrasentext_id_seq", "vilesci");
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropTable("system", "tbl_phrasentext");
|
||||
$this->dropTable("system", "tbl_phrase");
|
||||
$this->dropTable("system", "tbl_app");
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
require_once APPPATH . "/libraries/MigrationLib.php";
|
||||
|
||||
class Migration_Vorlage extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Change vorlage_kurzbz to varchar 32
|
||||
$columns = array(
|
||||
"vorlage_kurzbz" => array("type" => "varchar(32)")
|
||||
);
|
||||
$this->modifyColumn("public", "tbl_vorlage", $columns);
|
||||
|
||||
// Change vorlage_kurzbz to varchar 32
|
||||
$columns = array(
|
||||
"vorlage_kurzbz" => array("type" => "varchar(32)")
|
||||
);
|
||||
$this->modifyColumn("public", "tbl_vorlagestudiengang", $columns);
|
||||
|
||||
// Add attribute to public.tbl_vorlage
|
||||
$columns = array(
|
||||
"attribute" => array("type" => "json")
|
||||
);
|
||||
$this->addColumn("public", "tbl_vorlage", $columns);
|
||||
|
||||
// Add sprache, subject and orgform_kurzbz to public.tbl_vorlagestudiengang
|
||||
$columns = array(
|
||||
"sprache" => array("type" => "varchar(16)"),
|
||||
"subject" => array("type" => "text"),
|
||||
"orgform_kurzbz" => array("type" => "varchar(3)")
|
||||
);
|
||||
$this->addColumn("public", "tbl_vorlagestudiengang", $columns);
|
||||
|
||||
$this->initializeSequence(
|
||||
"public", "seq_vorlagestudiengang_vorlagestudiengang_id", "public",
|
||||
"tbl_vorlagestudiengang", "vorlagestudiengang_id"
|
||||
);
|
||||
|
||||
// Add foreign keys to tbl_vorlagestudiengang
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_vorlagestudiengang",
|
||||
"fk_vorlagestudiengang_sprache",
|
||||
"sprache",
|
||||
"public",
|
||||
"tbl_sprache",
|
||||
"sprache",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_vorlagestudiengang",
|
||||
"fk_vorlagestudiengang_orgform_kurzbz",
|
||||
"orgform_kurzbz",
|
||||
"bis",
|
||||
"tbl_orgform",
|
||||
"orgform_kurzbz",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropColumn("public", "tbl_vorlage", "attribute");
|
||||
$this->dropColumn("public", "tbl_vorlagestudiengang", "subject");
|
||||
$this->dropColumn("public", "tbl_vorlagestudiengang", "orgform_kurzbz");
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,270 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
require_once APPPATH . "/libraries/MigrationLib.php";
|
||||
|
||||
class Migration_Reihungstest extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Add stufe and anmeldefrist to public.tbl_reihungstest
|
||||
$columns = array(
|
||||
"stufe" => array("type" => "smallint"),
|
||||
"anmeldefrist" => array("type" => "date")
|
||||
);
|
||||
$this->addColumn("public", "tbl_reihungstest", $columns);
|
||||
|
||||
// Add arbeitsplaetze to public.tbl_ort
|
||||
$columns = array(
|
||||
"arbeitsplaetze" => array("type" => "integer", "null" => true)
|
||||
);
|
||||
$this->addColumn("public", "tbl_ort", $columns);
|
||||
|
||||
// Add rt_stufe and punkte to public.tbl_prestudentstatus
|
||||
$columns = array(
|
||||
"rt_stufe" => array("type" => "smallint DEFAULT NULL")
|
||||
);
|
||||
$this->addColumn("public", "tbl_prestudentstatus", $columns);
|
||||
|
||||
// Add studienplan_id to testtool.tbl_ablauf
|
||||
$columns = array(
|
||||
"studienplan_id" => array("type" => "integer", "null" => true)
|
||||
);
|
||||
$this->addColumn("testtool", "tbl_ablauf", $columns);
|
||||
|
||||
// Add aktiv to testtool.tbl_frage
|
||||
$columns = array(
|
||||
"aktiv" => array("type" => "boolean DEFAULT TRUE")
|
||||
);
|
||||
$this->addColumn("testtool", "tbl_frage", $columns);
|
||||
|
||||
// Add aktiv to testtool.tbl_vorschlag
|
||||
$columns = array(
|
||||
"aktiv" => array("type" => "boolean DEFAULT TRUE")
|
||||
);
|
||||
$this->addColumn("testtool", "tbl_vorschlag", $columns);
|
||||
|
||||
// Add bezeichnung_mehrsprachig to testtool.tbl_gebiet
|
||||
$columns = array(
|
||||
"bezeichnung_mehrsprachig" => array("type" => "varchar(255)[]")
|
||||
);
|
||||
$this->addColumn("testtool", "tbl_gebiet", $columns);
|
||||
$this->execQuery("UPDATE testtool.tbl_gebiet set bezeichnung_mehrsprachig = cast('{\"'||bezeichnung||'\",\"'||bezeichnung||'\"}' as varchar[]);");
|
||||
|
||||
// Create table public.tbl_rt_studienplan
|
||||
$fields = array(
|
||||
"reihungstest_id" => array(
|
||||
"type" => "integer"
|
||||
),
|
||||
"studienplan_id" => array(
|
||||
"type" => "integer"
|
||||
)
|
||||
);
|
||||
$this->createTable("public", "tbl_rt_studienplan", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"public",
|
||||
"tbl_rt_studienplan",
|
||||
"pk_tbl_rt_studienplan",
|
||||
array("reihungstest_id", "studienplan_id")
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_rt_studienplan",
|
||||
"fk_rt_studienplan_reihungstest_id",
|
||||
"reihungstest_id",
|
||||
"public",
|
||||
"tbl_reihungstest",
|
||||
"reihungstest_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_rt_studienplan",
|
||||
"fk_rt_studienplan_studienplan_id",
|
||||
"studienplan_id",
|
||||
"lehre",
|
||||
"tbl_studienplan",
|
||||
"studienplan_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
|
||||
$this->addForeingKey(
|
||||
"testtool",
|
||||
"tbl_ablauf",
|
||||
"fk_ablauf_studienplan_id",
|
||||
"studienplan_id",
|
||||
"lehre",
|
||||
"tbl_studienplan",
|
||||
"studienplan_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->grantTable("SELECT", "public", "tbl_rt_studienplan", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_rt_studienplan", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_rt_studienplan", "vilesci");
|
||||
|
||||
// Create table public.tbl_rt_person
|
||||
$fields = array(
|
||||
"rt_person_id" => array(
|
||||
"type" => "integer",
|
||||
"auto_increment" => true
|
||||
),
|
||||
"person_id" => array(
|
||||
"type" => "integer"
|
||||
),
|
||||
"rt_id" => array(
|
||||
"type" => "integer"
|
||||
),
|
||||
"studienplan_id" => array(
|
||||
"type" => "integer"
|
||||
),
|
||||
"anmeldedatum" => array(
|
||||
"type" => "date",
|
||||
"null" => true
|
||||
),
|
||||
"teilgenommen" => array(
|
||||
"type" => "boolean DEFAULT FALSE",
|
||||
"null" => true
|
||||
),
|
||||
"ort_kurzbz" => array(
|
||||
"type" => "varchar(16)",
|
||||
"null" => true
|
||||
),
|
||||
"punkte" => array(
|
||||
"type" => "numeric(8,4) DEFAULT NULL",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->createTable("public", "tbl_rt_person", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"public",
|
||||
"tbl_rt_person",
|
||||
"pk_tbl_rt_person",
|
||||
array("rt_person_id")
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_rt_person",
|
||||
"fk_rt_person_ort_kurzbz",
|
||||
"ort_kurzbz",
|
||||
"public",
|
||||
"tbl_ort",
|
||||
"ort_kurzbz",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_rt_person",
|
||||
"fk_rt_person_reihungstest_id",
|
||||
"rt_id",
|
||||
"public",
|
||||
"tbl_reihungstest",
|
||||
"reihungstest_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_rt_person",
|
||||
"fk_rt_person_studienplan_id",
|
||||
"studienplan_id",
|
||||
"lehre",
|
||||
"tbl_studienplan",
|
||||
"studienplan_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addUniqueKey(
|
||||
"public",
|
||||
"tbl_rt_person",
|
||||
"uk_tbl_rt_person_person_id_rt_id_studienplan_id",
|
||||
array("person_id","rt_id","studienplan_id")
|
||||
);
|
||||
$this->grantTable("SELECT", "public", "tbl_rt_person", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_rt_person", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_rt_person", "vilesci");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "public", "tbl_rt_person_rt_person_id_seq", "web");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "public", "tbl_rt_person_rt_person_id_seq", "admin");
|
||||
$this->grantSequence(array("SELECT", "UPDATE"), "public", "tbl_rt_person_rt_person_id_seq", "vilesci");
|
||||
|
||||
// Create table public.tbl_rt_ort
|
||||
$fields = array(
|
||||
"rt_id" => array(
|
||||
"type" => "integer"
|
||||
),
|
||||
"ort_kurzbz" => array(
|
||||
"type" => "varchar(16)"
|
||||
),
|
||||
"uid" => array(
|
||||
"type" => "varchar(32)",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->createTable("public", "tbl_rt_ort", $fields);
|
||||
$this->addPrimaryKey(
|
||||
"public",
|
||||
"tbl_rt_ort",
|
||||
"pk_tbl_rt_ort",
|
||||
array("rt_id", "ort_kurzbz")
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_rt_ort",
|
||||
"fk_rt_ort_reihungstest_id",
|
||||
"rt_id",
|
||||
"public",
|
||||
"tbl_reihungstest",
|
||||
"reihungstest_id",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_rt_ort",
|
||||
"fk_rt_ort_ort_kurzbz",
|
||||
"ort_kurzbz",
|
||||
"public",
|
||||
"tbl_ort",
|
||||
"ort_kurzbz",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->addForeingKey(
|
||||
"public",
|
||||
"tbl_rt_ort",
|
||||
"fk_rt_ort_uid",
|
||||
"uid",
|
||||
"public",
|
||||
"tbl_benutzer",
|
||||
"uid",
|
||||
"ON UPDATE CASCADE ON DELETE RESTRICT"
|
||||
);
|
||||
$this->grantTable("SELECT", "public", "tbl_rt_ort", "web");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_rt_ort", "admin");
|
||||
$this->grantTable(array("SELECT", "INSERT", "DELETE", "UPDATE"), "public", "tbl_rt_ort", "vilesci");
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropColumn("public", "tbl_reihungstest", "stufe");
|
||||
$this->dropColumn("public", "tbl_reihungstest", "anmeldefrist");
|
||||
$this->dropColumn("public", "tbl_prestudentstatus", "rt_stufe");
|
||||
$this->dropColumn("testtool", "tbl_ablauf", "studienplan_id");
|
||||
$this->dropColumn("testtool", "tbl_frage", "aktiv");
|
||||
$this->dropColumn("testtool", "tbl_vorschlag", "aktiv");
|
||||
$this->dropColumn("testtool", "tbl_gebiet", "bezeichnung_mehrsprachig");
|
||||
|
||||
$this->dropTable("public", "tbl_rt_studienplan");
|
||||
$this->dropTable("public", "tbl_rt_person");
|
||||
$this->dropTable("public", "tbl_rt_ort");
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . '/libraries/MigrationLib.php';
|
||||
|
||||
class Migration_Bewerbungsfrist extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Create table lehre.tbl_bewerbungsfrist
|
||||
$fields = array(
|
||||
'bewerbungsfrist_id' => array(
|
||||
'type' => 'integer',
|
||||
'auto_increment' => true
|
||||
),
|
||||
'studiensemester_kurzbz' => array(
|
||||
'type' => 'varchar(16)'
|
||||
),
|
||||
'begin' => array(
|
||||
'type' => 'date'
|
||||
),
|
||||
'ende' => array(
|
||||
'type' => 'date'
|
||||
),
|
||||
'ende' => array(
|
||||
'type' => 'date'
|
||||
),
|
||||
'nachfrist' => array(
|
||||
'type' => 'boolean DEFAULT FALSE',
|
||||
'null' => true
|
||||
),
|
||||
'nachfristende' => array(
|
||||
'type' => 'date',
|
||||
'null' => true
|
||||
),
|
||||
'anmerkung' => array(
|
||||
'type' => 'text'
|
||||
),
|
||||
'insertamum' => array(
|
||||
'type' => 'timestamp DEFAULT NOW()',
|
||||
'null' => true
|
||||
),
|
||||
'insertvon' => array(
|
||||
'type' => 'varchar(32)',
|
||||
'null' => true
|
||||
),
|
||||
'updateamum' => array(
|
||||
'type' => 'timestamp DEFAULT NOW()',
|
||||
'null' => true
|
||||
),
|
||||
'updatevon' => array(
|
||||
'type' => 'varchar(32)',
|
||||
'null' => true
|
||||
)
|
||||
);
|
||||
$this->createTable('lehre', 'tbl_bewerbungsfrist', $fields);
|
||||
$this->addPrimaryKey(
|
||||
'lehre',
|
||||
'tbl_bewerbungsfrist',
|
||||
'pk_tbl_bewerbungsfrist',
|
||||
array('bewerbungsfrist_id')
|
||||
);
|
||||
$this->addForeingKey(
|
||||
'lehre',
|
||||
'tbl_bewerbungsfrist',
|
||||
'fk_bewerbungsfrist_studiensemester_kurzbz',
|
||||
'studiensemester_kurzbz',
|
||||
'public',
|
||||
'tbl_studiensemester',
|
||||
'studiensemester_kurzbz',
|
||||
'ON UPDATE CASCADE ON DELETE RESTRICT'
|
||||
);
|
||||
$this->grantTable('SELECT', 'lehre', 'tbl_bewerbungsfrist', 'web');
|
||||
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist', 'admin');
|
||||
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist', 'vilesci');
|
||||
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'web');
|
||||
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'admin');
|
||||
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'vilesci');
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropTable('lehre', 'tbl_bewerbungsfrist');
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
require_once APPPATH . "/libraries/MigrationLib.php";
|
||||
|
||||
class Migration_Akte extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Add nachgereicht_am to public.tbl_akte
|
||||
$columns = array(
|
||||
"nachgereicht_am" => array(
|
||||
"type" => "date",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->addColumn("public", "tbl_akte", $columns);
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropColumn("public", "tbl_akte", "nachgereicht_am");
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
require_once APPPATH . "/libraries/MigrationLib.php";
|
||||
|
||||
class Migration_Person extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Add zugangscode_timestamp to public.tbl_person
|
||||
$columns = array(
|
||||
"zugangscode_timestamp" => array(
|
||||
"type" => "timestamp",
|
||||
"null" => true
|
||||
)
|
||||
);
|
||||
$this->addColumn("public", "tbl_person", $columns);
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropColumn("public", "tbl_person", "zugangscode_timestamp");
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
require_once APPPATH . "/libraries/MigrationLib.php";
|
||||
|
||||
class Migration_Person_svnr extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
$this->execQuery("ALTER TABLE public.tbl_person DROP CONSTRAINT chk_person_svnr");
|
||||
$this->execQuery(
|
||||
"ALTER TABLE public.tbl_person
|
||||
ADD CONSTRAINT chk_person_svnr
|
||||
CHECK (
|
||||
char_length(svnr::text) = 10 OR
|
||||
char_length(svnr::text) = 12 OR
|
||||
char_length(svnr::text) = 16 OR
|
||||
svnr IS NULL
|
||||
)"
|
||||
);
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->execQuery("ALTER TABLE public.tbl_person DROP CONSTRAINT chk_person_svnr");
|
||||
$this->execQuery(
|
||||
"ALTER TABLE public.tbl_person
|
||||
ADD CONSTRAINT chk_person_svnr
|
||||
CHECK (
|
||||
char_length(svnr::text) = 10 OR
|
||||
char_length(svnr::text) = 16 OR
|
||||
svnr IS NULL
|
||||
)"
|
||||
);
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . '/libraries/MigrationLib.php';
|
||||
|
||||
class Migration_Bewerbungsfrist2 extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
$this->dropTable('lehre', 'tbl_bewerbungsfrist');
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
// Create table lehre.tbl_bewerbungsfrist
|
||||
$fields = array(
|
||||
'bewerbungsfrist_id' => array(
|
||||
'type' => 'integer',
|
||||
'auto_increment' => true
|
||||
),
|
||||
'studiensemester_kurzbz' => array(
|
||||
'type' => 'varchar(16)'
|
||||
),
|
||||
'begin' => array(
|
||||
'type' => 'date'
|
||||
),
|
||||
'ende' => array(
|
||||
'type' => 'date'
|
||||
),
|
||||
'ende' => array(
|
||||
'type' => 'date'
|
||||
),
|
||||
'nachfrist' => array(
|
||||
'type' => 'boolean DEFAULT FALSE',
|
||||
'null' => true
|
||||
),
|
||||
'nachfristende' => array(
|
||||
'type' => 'date',
|
||||
'null' => true
|
||||
),
|
||||
'anmerkung' => array(
|
||||
'type' => 'text'
|
||||
),
|
||||
'insertamum' => array(
|
||||
'type' => 'timestamp DEFAULT NOW()',
|
||||
'null' => true
|
||||
),
|
||||
'insertvon' => array(
|
||||
'type' => 'varchar(32)',
|
||||
'null' => true
|
||||
),
|
||||
'updateamum' => array(
|
||||
'type' => 'timestamp DEFAULT NOW()',
|
||||
'null' => true
|
||||
),
|
||||
'updatevon' => array(
|
||||
'type' => 'varchar(32)',
|
||||
'null' => true
|
||||
)
|
||||
);
|
||||
$this->createTable('lehre', 'tbl_bewerbungsfrist', $fields);
|
||||
$this->addPrimaryKey(
|
||||
'lehre',
|
||||
'tbl_bewerbungsfrist',
|
||||
'pk_tbl_bewerbungsfrist',
|
||||
array('bewerbungsfrist_id')
|
||||
);
|
||||
$this->addForeingKey(
|
||||
'lehre',
|
||||
'tbl_bewerbungsfrist',
|
||||
'fk_bewerbungsfrist_studiensemester_kurzbz',
|
||||
'studiensemester_kurzbz',
|
||||
'public',
|
||||
'tbl_studiensemester',
|
||||
'studiensemester_kurzbz',
|
||||
'ON UPDATE CASCADE ON DELETE RESTRICT'
|
||||
);
|
||||
$this->grantTable('SELECT', 'lehre', 'tbl_bewerbungsfrist', 'web');
|
||||
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist', 'admin');
|
||||
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist', 'vilesci');
|
||||
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'web');
|
||||
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'admin');
|
||||
$this->grantSequence(array('SELECT', 'UPDATE'), 'lehre', 'tbl_bewerbungsfrist_bewerbungsfrist_id_seq', 'vilesci');
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
@@ -1,72 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . '/libraries/MigrationLib.php';
|
||||
|
||||
class Migration_Status_grund extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
$fields = array(
|
||||
'statusgrund_kurzbz' => array(
|
||||
'type' => 'integer',
|
||||
'auto_increment' => true
|
||||
),
|
||||
'status_kurzbz' => array(
|
||||
'type' => 'varchar(20)'
|
||||
),
|
||||
'aktiv' => array(
|
||||
'type' => 'boolean DEFAULT FALSE',
|
||||
'null' => true
|
||||
),
|
||||
'bezeichnung_mehrsprachig' => array(
|
||||
'type' => 'varchar(255)[]'
|
||||
),
|
||||
'beschreibung' => array(
|
||||
'type' => 'text[]'
|
||||
)
|
||||
);
|
||||
$this->createTable('public', 'tbl_status_grund', $fields);
|
||||
$this->addPrimaryKey(
|
||||
'public',
|
||||
'tbl_status_grund',
|
||||
'pk_tbl_status_grund',
|
||||
array('statusgrund_kurzbz')
|
||||
);
|
||||
$this->addForeingKey(
|
||||
'public',
|
||||
'tbl_status_grund',
|
||||
'fk_status_grundstatus_kurzbz',
|
||||
'status_kurzbz',
|
||||
'public',
|
||||
'tbl_status',
|
||||
'status_kurzbz',
|
||||
'ON UPDATE CASCADE ON DELETE RESTRICT'
|
||||
);
|
||||
$this->grantTable('SELECT', 'public', 'tbl_status_grund', 'web');
|
||||
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'public', 'tbl_status_grund', 'admin');
|
||||
$this->grantTable(array('SELECT', 'INSERT', 'DELETE', 'UPDATE'), 'public', 'tbl_status_grund', 'vilesci');
|
||||
$this->grantSequence(array('SELECT', 'UPDATE'), 'public', 'tbl_status_grund_statusgrund_kurzbz_seq', 'web');
|
||||
$this->grantSequence(array('SELECT', 'UPDATE'), 'public', 'tbl_status_grund_statusgrund_kurzbz_seq', 'admin');
|
||||
$this->grantSequence(array('SELECT', 'UPDATE'), 'public', 'tbl_status_grund_statusgrund_kurzbz_seq', 'vilesci');
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropTable('public', 'tbl_status_grund');
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . '/libraries/MigrationLib.php';
|
||||
|
||||
class Migration_Dokumentprestudent extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Change mitarbeiter_uid could be null
|
||||
$this->execQuery('ALTER TABLE public.tbl_dokumentprestudent ALTER mitarbeiter_uid DROP NOT NULL');
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
// Change mitarbeiter_uid could not be null
|
||||
$this->execQuery('ALTER TABLE public.tbl_dokumentprestudent ALTER mitarbeiter_uid SET NOT NULL');
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,38 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . '/libraries/MigrationLib.php';
|
||||
|
||||
class Migration_Dokumentstudiengang extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
// Add nachreichbar to public.tbl_dokumentstudiengang
|
||||
$columns = array(
|
||||
'nachreichbar' => array(
|
||||
'type' => 'boolean DEFAULT FALSE',
|
||||
'null' => false
|
||||
)
|
||||
);
|
||||
$this->addColumn('public', 'tbl_dokumentstudiengang', $columns);
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
|
||||
$this->dropColumn('public', 'tbl_dokumentstudiengang', 'nachreichbar');
|
||||
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
@@ -1,197 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once APPPATH . '/libraries/MigrationLib.php';
|
||||
|
||||
class Migration_Reihungstestperson extends MigrationLib
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function up()
|
||||
{
|
||||
$this->startUP();
|
||||
|
||||
$this->execQuery('CREATE OR REPLACE VIEW testtool.vw_auswertung_ablauf AS
|
||||
SELECT tbl_gebiet.gebiet_id,
|
||||
tbl_gebiet.bezeichnung AS gebiet,
|
||||
tbl_ablauf.reihung,
|
||||
tbl_gebiet.maxpunkte,
|
||||
tbl_pruefling.pruefling_id,
|
||||
tbl_pruefling.prestudent_id,
|
||||
tbl_person.vorname,
|
||||
tbl_person.nachname,
|
||||
tbl_person.gebdatum,
|
||||
tbl_person.geschlecht,
|
||||
tbl_pruefling.semester,
|
||||
upper(tbl_studiengang.typ::character varying(1)::text || tbl_studiengang.kurzbz::text) AS stg_kurzbz,
|
||||
tbl_studiengang.bezeichnung AS stg_bez,
|
||||
tbl_pruefling.registriert,
|
||||
tbl_pruefling.idnachweis,
|
||||
(
|
||||
SELECT sum(tbl_vorschlag.punkte) AS sum
|
||||
FROM
|
||||
testtool.tbl_vorschlag
|
||||
JOIN testtool.tbl_antwort USING (vorschlag_id)
|
||||
JOIN testtool.tbl_frage USING (frage_id)
|
||||
WHERE
|
||||
tbl_antwort.pruefling_id = tbl_pruefling.pruefling_id
|
||||
AND tbl_frage.gebiet_id = tbl_gebiet.gebiet_id
|
||||
) AS punkte,
|
||||
tbl_rt_person.rt_id as reihungstest_id,
|
||||
tbl_ablauf.gewicht
|
||||
FROM
|
||||
testtool.tbl_pruefling
|
||||
JOIN testtool.tbl_ablauf ON (tbl_ablauf.studiengang_kz = tbl_pruefling.studiengang_kz)
|
||||
JOIN testtool.tbl_gebiet USING (gebiet_id)
|
||||
JOIN public.tbl_prestudent USING (prestudent_id)
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
JOIN public.tbl_rt_person USING (person_id)
|
||||
JOIN lehre.tbl_studienplan ON (tbl_studienplan.studienplan_id=tbl_rt_person.studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung ON(tbl_studienordnung.studienordnung_id = tbl_studienplan.studienordnung_id)
|
||||
JOIN public.tbl_studiengang ON (tbl_prestudent.studiengang_kz = tbl_studiengang.studiengang_kz)
|
||||
WHERE
|
||||
NOT (tbl_ablauf.gebiet_id IN ( SELECT tbl_kategorie.gebiet_id FROM testtool.tbl_kategorie))
|
||||
AND tbl_studienordnung.studiengang_kz=tbl_pruefling.studiengang_kz;
|
||||
|
||||
CREATE OR REPLACE VIEW testtool.vw_auswertung_kategorie_semester AS
|
||||
SELECT
|
||||
tbl_kategorie.kategorie_kurzbz,
|
||||
tbl_person.vorname,
|
||||
tbl_person.nachname,
|
||||
tbl_person.gebdatum,
|
||||
tbl_person.geschlecht,
|
||||
tbl_prestudent.prestudent_id,
|
||||
tbl_rt_person.rt_id as reihungstest_id,
|
||||
tbl_gebiet.gebiet_id,
|
||||
upper(tbl_studiengang.typ::character varying(1)::text || tbl_studiengang.kurzbz::text) AS stg_kurzbz,
|
||||
tbl_studiengang.bezeichnung AS stg_bez,
|
||||
tbl_pruefling.registriert,
|
||||
tbl_pruefling.idnachweis,
|
||||
tbl_pruefling.semester,
|
||||
tbl_pruefling.pruefling_id,
|
||||
(
|
||||
SELECT
|
||||
sum(tbl_vorschlag.punkte) AS sum
|
||||
FROM
|
||||
testtool.tbl_vorschlag
|
||||
JOIN testtool.tbl_antwort USING (vorschlag_id)
|
||||
JOIN testtool.tbl_frage USING (frage_id)
|
||||
WHERE
|
||||
tbl_antwort.pruefling_id = tbl_pruefling.pruefling_id
|
||||
AND tbl_frage.gebiet_id = tbl_gebiet.gebiet_id
|
||||
AND tbl_frage.kategorie_kurzbz::text = tbl_kategorie.kategorie_kurzbz::text
|
||||
) AS punkte
|
||||
FROM
|
||||
testtool.tbl_pruefling
|
||||
JOIN testtool.tbl_ablauf ON (tbl_ablauf.studiengang_kz = tbl_pruefling.studiengang_kz)
|
||||
JOIN testtool.tbl_gebiet USING (gebiet_id)
|
||||
JOIN testtool.tbl_kategorie USING (gebiet_id)
|
||||
JOIN public.tbl_prestudent USING (prestudent_id)
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
JOIN public.tbl_studiengang ON (tbl_prestudent.studiengang_kz = tbl_studiengang.studiengang_kz)
|
||||
JOIN public.tbl_rt_person USING(person_id)
|
||||
JOIN lehre.tbl_studienplan ON(tbl_studienplan.studienplan_id=tbl_rt_person.studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung ON(tbl_studienordnung.studienordnung_id = tbl_studienplan.studienordnung_id)
|
||||
WHERE
|
||||
tbl_studienordnung.studiengang_kz = tbl_pruefling.studiengang_kz;
|
||||
|
||||
CREATE OR REPLACE VIEW testtool.vw_auswertung_kategorie AS
|
||||
SELECT
|
||||
tbl_kategorie.kategorie_kurzbz,
|
||||
tbl_person.vorname,
|
||||
tbl_person.nachname,
|
||||
tbl_person.gebdatum,
|
||||
tbl_person.geschlecht,
|
||||
tbl_prestudent.prestudent_id,
|
||||
tbl_rt_person.rt_id as reihungstest_id,
|
||||
tbl_gebiet.gebiet_id,
|
||||
upper(tbl_studiengang.typ::character varying(1)::text || tbl_studiengang.kurzbz::text) AS stg_kurzbz,
|
||||
tbl_studiengang.bezeichnung AS stg_bez,
|
||||
tbl_pruefling.registriert,
|
||||
tbl_pruefling.idnachweis,
|
||||
tbl_pruefling.semester,
|
||||
tbl_pruefling.pruefling_id,
|
||||
(
|
||||
SELECT
|
||||
sum(tbl_vorschlag.punkte) AS sum
|
||||
FROM
|
||||
testtool.tbl_vorschlag
|
||||
JOIN testtool.tbl_antwort USING (vorschlag_id)
|
||||
JOIN testtool.tbl_frage USING (frage_id)
|
||||
WHERE
|
||||
tbl_antwort.pruefling_id = tbl_pruefling.pruefling_id
|
||||
AND tbl_frage.gebiet_id = tbl_gebiet.gebiet_id
|
||||
AND tbl_frage.kategorie_kurzbz::text = tbl_kategorie.kategorie_kurzbz::text
|
||||
) AS punkte
|
||||
FROM
|
||||
testtool.tbl_pruefling
|
||||
JOIN testtool.tbl_ablauf ON (tbl_ablauf.studiengang_kz = tbl_pruefling.studiengang_kz AND tbl_ablauf.semester = tbl_pruefling.semester)
|
||||
JOIN testtool.tbl_gebiet USING (gebiet_id)
|
||||
JOIN testtool.tbl_kategorie USING (gebiet_id)
|
||||
JOIN public.tbl_prestudent USING (prestudent_id)
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
JOIN public.tbl_studiengang ON (tbl_prestudent.studiengang_kz = tbl_studiengang.studiengang_kz)
|
||||
JOIN public.tbl_rt_person USING(person_id)
|
||||
JOIN lehre.tbl_studienplan ON (tbl_studienplan.studienplan_id = tbl_rt_person.studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung ON (tbl_studienordnung.studienordnung_id = tbl_studienplan.studienordnung_id)
|
||||
WHERE
|
||||
tbl_studienordnung.studiengang_kz=tbl_pruefling.studiengang_kz;
|
||||
|
||||
CREATE OR REPLACE VIEW testtool.vw_auswertung AS
|
||||
SELECT
|
||||
tbl_gebiet.gebiet_id,
|
||||
tbl_gebiet.bezeichnung AS gebiet,
|
||||
tbl_gebiet.maxpunkte,
|
||||
tbl_pruefling.pruefling_id,
|
||||
tbl_pruefling.prestudent_id,
|
||||
tbl_person.vorname,
|
||||
tbl_person.nachname,
|
||||
tbl_person.gebdatum,
|
||||
tbl_person.geschlecht,
|
||||
tbl_pruefling.semester,
|
||||
upper(tbl_studiengang.typ::character varying(1)::text || tbl_studiengang.kurzbz::text) AS stg_kurzbz,
|
||||
tbl_studiengang.bezeichnung AS stg_bez,
|
||||
tbl_pruefling.registriert,
|
||||
tbl_pruefling.idnachweis,
|
||||
(
|
||||
SELECT
|
||||
sum(tbl_vorschlag.punkte) AS sum
|
||||
FROM
|
||||
testtool.tbl_vorschlag
|
||||
JOIN testtool.tbl_antwort USING (vorschlag_id)
|
||||
JOIN testtool.tbl_frage USING (frage_id)
|
||||
WHERE
|
||||
tbl_antwort.pruefling_id = tbl_pruefling.pruefling_id
|
||||
AND tbl_frage.gebiet_id = tbl_gebiet.gebiet_id
|
||||
) AS punkte,
|
||||
tbl_rt_person.rt_id as reihungstest_id,
|
||||
tbl_ablauf.gewicht,
|
||||
tbl_person.person_id
|
||||
FROM
|
||||
testtool.tbl_pruefling
|
||||
JOIN testtool.tbl_ablauf ON (tbl_ablauf.studiengang_kz = tbl_pruefling.studiengang_kz AND tbl_ablauf.semester = tbl_pruefling.semester)
|
||||
JOIN testtool.tbl_gebiet USING (gebiet_id)
|
||||
JOIN public.tbl_prestudent USING (prestudent_id)
|
||||
JOIN public.tbl_person USING (person_id)
|
||||
JOIN public.tbl_studiengang ON tbl_prestudent.studiengang_kz = tbl_studiengang.studiengang_kz
|
||||
JOIN public.tbl_rt_person USING (person_id)
|
||||
JOIN lehre.tbl_studienplan ON (tbl_studienplan.studienplan_id = tbl_rt_person.studienplan_id)
|
||||
JOIN lehre.tbl_studienordnung ON (tbl_studienordnung.studienordnung_id = tbl_studienplan.studienordnung_id)
|
||||
WHERE
|
||||
tbl_studienordnung.studiengang_kz = tbl_prestudent.studiengang_kz
|
||||
AND NOT (tbl_ablauf.gebiet_id IN ( SELECT tbl_kategorie.gebiet_id
|
||||
FROM testtool.tbl_kategorie));');
|
||||
|
||||
$this->endUP();
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
$this->startDown();
|
||||
$this->endDown();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user