qualgate 1&2 dbupdate script, note fkey reference & upload required flag in paabgabe; noten api duplicate from notentool for now; WIP more emails; qualgates benotbar & saveable aswell as upload flag;

This commit is contained in:
Johann Hoffmann
2025-08-26 17:15:37 +02:00
parent e97c26022f
commit 63390b192c
12 changed files with 256 additions and 93 deletions
@@ -27,3 +27,36 @@ if($result = $db->db_query("SELECT 1 FROM campus.tbl_paabgabetyp WHERE paabgabet
echo '<br>paabgabetyp quality gate 2 hinzugefuegt';
}
}
if($result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'campus' AND table_name = 'tbl_paabgabe' AND column_name = 'note'"))
{
if($db->db_num_rows($result) === 0)
{
$qry = "ALTER TABLE campus.tbl_paabgabe
ADD COLUMN note SMALLINT NOT NULL DEFAULT 9,
ADD CONSTRAINT tbl_paabgabe_note_fkey
FOREIGN KEY (note)
REFERENCES lehre.tbl_note(note)
ON UPDATE CASCADE ON DELETE RESTRICT;";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabe: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabe column note default 9 (noch nicht eingetragen) hinzugefuegt';
}
}
if($result = $db->db_query("SELECT 1 FROM information_schema.columns WHERE table_schema = 'campus' AND table_name = 'tbl_paabgabe' AND column_name = 'upload_required'"))
{
if($db->db_num_rows($result) === 0)
{
$qry = "ALTER TABLE campus.tbl_paabgabe
ADD COLUMN IF NOT EXISTS upload_required boolean DEFAULT false;";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_paabgabe: '.$db->db_last_error().'</strong><br>';
else
echo '<br>paabgabe column upload_required default false hinzugefuegt';
}
}