- added not null constraint on hr.tbl_stundensatz.uid

This commit is contained in:
ma0048
2024-04-02 14:55:42 +02:00
parent 8d2d1c049a
commit 58ad10c0a3
2 changed files with 17 additions and 0 deletions
+1
View File
@@ -53,6 +53,7 @@ require_once('dbupdate_3.4/36275_zeitaufzeichnung_karenz.php');
require_once('dbupdate_3.4/21620_neues_feld_zum_erfassen_des_ESI.php');
require_once('dbupdate_3.4/36530_bis_internationsalisierung_codextabelle_neuerungen.php');
require_once('dbupdate_3.4/34543_ux_template.php');
require_once('dbupdate_3.4/39221_stundensatz_ohne_uid_sollte_nicht_gespeichert_werden.php');
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';
@@ -0,0 +1,16 @@
<?php
if (! defined('DB_NAME')) exit('No direct script access allowed');
// Add NOT NULL constraint on uid on hr.tbl_stundensatz
if($result = @$db->db_query("SELECT is_nullable FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_SCHEMA = 'hr' AND TABLE_NAME = 'tbl_stundensatz' AND COLUMN_NAME = 'uid' AND is_nullable = 'YES'"))
{
if($db->db_num_rows($result) == 1)
{
$qry = "ALTER TABLE hr.tbl_stundensatz ALTER COLUMN uid SET NOT NULL";
if (!$db->db_query($qry))
echo '<strong>hr.tbl_stundensatz '.$db->db_last_error().'</strong><br>';
else
echo '<br>Added NOT NULL constraint on "uid" hr.tbl_stundensatz<br>';
}
}