mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 09:04:28 +00:00
dbupdate entry; WIP table altering statements for lehre.tbl_projektarbeit
This commit is contained in:
@@ -92,6 +92,7 @@ require_once('dbupdate_3.4/68744_StV_settings.php');
|
|||||||
require_once('dbupdate_3.4/62889_reihungstest_ueberwachung_mit_constructor.php');
|
require_once('dbupdate_3.4/62889_reihungstest_ueberwachung_mit_constructor.php');
|
||||||
require_once('dbupdate_3.4/71399_dashboard_update_widget_paths.php');
|
require_once('dbupdate_3.4/71399_dashboard_update_widget_paths.php');
|
||||||
require_once('dbupdate_3.4/71645_studvw_messagetab_ladezeit.php');
|
require_once('dbupdate_3.4/71645_studvw_messagetab_ladezeit.php');
|
||||||
|
require_once('dbupdate_3.4/75469_le_optional_4_projektarbeit.php');
|
||||||
|
|
||||||
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
|
||||||
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
|
||||||
|
|||||||
@@ -0,0 +1,48 @@
|
|||||||
|
<?php
|
||||||
|
if (! defined('DB_NAME')) exit('No direct script access allowed');
|
||||||
|
|
||||||
|
if($result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'lehre' AND table_name = 'tbl_projektarbeit' AND column_name = 'lehrveranstaltung_id'"))
|
||||||
|
{
|
||||||
|
if($db->db_num_rows($result) === 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
$qry = "ALTER TABLE lehre.tbl_projektarbeit
|
||||||
|
ADD COLUMN IF NOT EXISTS lehrveranstaltung_id INTEGER;";
|
||||||
|
|
||||||
|
if(!$db->db_query($qry))
|
||||||
|
echo '<strong>lehre.tbl_projektarbeit: '.$db->db_last_error().'</strong><br>';
|
||||||
|
else
|
||||||
|
echo '<br>tbl_projektarbeit column lehrveranstaltung_id hinzugefuegt';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: check for and add fk constraint lehrveranstaltung_id
|
||||||
|
//if($result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'lehre' AND table_name = 'tbl_projektarbeit' AND column_name = 'lehrveranstaltung_id'"))
|
||||||
|
//{
|
||||||
|
// if($db->db_num_rows($result) === 0)
|
||||||
|
// {
|
||||||
|
//
|
||||||
|
// $qry = "ALTER TABLE lehre.tbl_projektarbeit
|
||||||
|
// ADD COLUMN IF NOT EXISTS lehrveranstaltung_id INTEGER;";
|
||||||
|
//
|
||||||
|
// if(!$db->db_query($qry))
|
||||||
|
// echo '<strong>lehre.tbl_projektarbeit: '.$db->db_last_error().'</strong><br>';
|
||||||
|
// else
|
||||||
|
// echo '<br>tbl_projektarbeit column lehrveranstaltung_id hinzugefuegt';
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
if($result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'lehre' AND table_name = 'tbl_projektarbeit' AND column_name = 'studiensemester_kurzbz'"))
|
||||||
|
{
|
||||||
|
if($db->db_num_rows($result) === 0)
|
||||||
|
{
|
||||||
|
|
||||||
|
$qry = "ALTER TABLE lehre.tbl_projektarbeit
|
||||||
|
ADD COLUMN IF NOT EXISTS lehrveranstaltung_id INTEGER;";
|
||||||
|
|
||||||
|
if(!$db->db_query($qry))
|
||||||
|
echo '<strong>lehre.tbl_projektarbeit: '.$db->db_last_error().'</strong><br>';
|
||||||
|
else
|
||||||
|
echo '<br>tbl_projektarbeit column lehrveranstaltung_id hinzugefuegt';
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user