 
 ---# Adding new columns to log_group_requests
 ALTER TABLE {$db_prefix}log_group_requests
-ADD COLUMN status smallint NOT NULL default '0',
-ADD COLUMN id_member_acted int NOT NULL default '0',
-ADD COLUMN member_name_acted varchar(255) NOT NULL default '',
-ADD COLUMN time_acted int NOT NULL default '0',
-ADD COLUMN act_reason text NOT NULL;
+ADD COLUMN IF NOT EXISTS status smallint NOT NULL default '0',
+ADD COLUMN IF NOT EXISTS id_member_acted int NOT NULL default '0',
+ADD COLUMN IF NOT EXISTS member_name_acted varchar(255) NOT NULL default '',
+ADD COLUMN IF NOT EXISTS time_acted int NOT NULL default '0',
+ADD COLUMN IF NOT EXISTS act_reason text NOT NULL;
 ---#
 
 ---# Adjusting the indexes for log_group_requests

/******************************************************************************/
---# Adding the secret column to members table
ALTER TABLE {$db_prefix}members
ADD COLUMN tfa_secret VARCHAR(24) NOT NULL DEFAULT '';
---#

---# Adding the backup column to members tab
ALTER TABLE {$db_prefix}members
ADD COLUMN tfa_backup VARCHAR(64) NOT NULL DEFAULT '';
---#

---# Force 2FA per membergroup
ALTER TABLE {$db_prefix}membergroups
ADD COLUMN tfa_required smallint NOT NULL default '0';
---#

---# Add tfa_mode setting

/******************************************************************************/
---# Add start_time end_time, and timezone columns to calendar table
ALTER TABLE {$db_prefix}calendar
ADD COLUMN IF NOT EXISTS start_time time,
ADD COLUMN IF NOT EXISTS end_time time,
ADD COLUMN IF NOT EXISTS timezone VARCHAR(80);
---#

---# Update cal_maxspan and drop obsolete cal_allowspan setting
