mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-24 10:22:18 +00:00
adds topic field to the cis_profil_update table and changes the layout of the editProfil Modul
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
{
|
||||
$qry = "CREATE TABLE public.tbl_cis_profil_update (
|
||||
profil_update_id INTEGER NOT NULL,
|
||||
topic VARCHAR(32) NOT NULL,
|
||||
uid VARCHAR(32) NOT NULL,
|
||||
requested_change jsonb NOT NULL,
|
||||
change_timestamp TIMESTAMP NOT NULL,
|
||||
@@ -16,8 +17,9 @@
|
||||
NO MAXVALUE
|
||||
NO MINVALUE
|
||||
CACHE 1;
|
||||
|
||||
ALTER TABLE public.tbl_cis_profil_update ALTER COLUMN profil_update_id SET DEFAULT nextval('public.tbl_cis_profil_update_id_seq');
|
||||
|
||||
ALTER TABLE public.tbl_cis_profil_update ADD CONSTRAINT cis_profil_udpate_topic_uid_unique UNIQUE (uid,topic);
|
||||
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_cis_profil_update TO vilesci;
|
||||
GRANT SELECT, INSERT, UPDATE, DELETE ON public.tbl_cis_profil_update TO web;
|
||||
@@ -31,35 +33,14 @@
|
||||
echo '<br>public.tbl_cis_profil_update: table created';
|
||||
}
|
||||
|
||||
/* else{
|
||||
$qry = "DROP TABLE public.tbl_cis_profil_update;";
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong> was not able to delete public.tbl_cis_profil_update: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_cis_profil_update: table deleted';
|
||||
} */
|
||||
|
||||
|
||||
/* if($db->db_num_rows($result)==0)
|
||||
{
|
||||
$qry = "INSERT INTO public.tbl_cis_profil_update(uid, profil_data, profil_changes, change_timestamp) VALUES('ma0594','{\"test\":\"data\"}', NOW());";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>Prüfungstyp: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>test eintrag in public.tbl_cis_profil_update hinzugefügt';
|
||||
} */
|
||||
|
||||
|
||||
//! was used to add an extra column to the table after the table was already created
|
||||
/*
|
||||
|
||||
if(!$result = @$db->db_query("SELECT profil_data FROM public.tbl_cis_profil_update LIMIT 1"))
|
||||
//? would add a column if the column is missing in the table
|
||||
/* if(!$result = @$db->db_query("SELECT topic FROM public.tbl_cis_profil_update LIMIT 1"))
|
||||
{
|
||||
$qry = "ALTER TABLE public.tbl_cis_profil_update ADD COLUMN profil_data jsonb;";
|
||||
$qry = "ALTER TABLE public.tbl_cis_profil_update ADD COLUMN topic varchar(32) NOT NULL;";
|
||||
|
||||
if(!$db->db_query($qry))
|
||||
echo '<strong>public.tbl_cis_profil_update: '.$db->db_last_error().'</strong><br>';
|
||||
else
|
||||
echo '<br>public.tbl_cis_profil_update: Spalte profil_data hinzugefuegt';
|
||||
} */
|
||||
echo '<br>public.tbl_cis_profil_update: Spalte topic hinzugefuegt';
|
||||
} */
|
||||
Reference in New Issue
Block a user