Datentyp der Spalte nummer in campus.tbl_beispiel von smallint auf integer geändert da es sonst zu einem Überlauf kommt

This commit is contained in:
oesi
2017-02-02 13:47:02 +01:00
parent 8774f1b31d
commit dc494a3d45
+17
View File
@@ -1466,6 +1466,23 @@ if($result = $db->db_query("SELECT character_maximum_length FROM information_sch
}
}
// Nummer in campus.tbl_beispiel von smallint auf integer aendern
if($result = $db->db_query("SELECT data_type FROM information_schema.columns WHERE column_name='nummer' AND table_name='tbl_beispiel' AND table_schema='campus';"))
{
if($row = $db->db_fetch_object($result))
{
if($row->data_type=='smallint')
{
$qry = "ALTER TABLE campus.tbl_beispiel ALTER COLUMN nummer TYPE integer;";
if(!$db->db_query($qry))
echo '<strong>campus.tbl_beispiel: '.$db->db_last_error().'</strong><br>';
else
echo 'campus.tbl_beispiel: Spalte nummer von smallint auf integer geändert<br>';
}
}
}
// *** Pruefung und hinzufuegen der neuen Attribute und Tabellen
echo '<H2>Pruefe Tabellen und Attribute!</H2>';