diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-04-07 10:09:36 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-04-07 10:09:36 +0200 |
commit | 098793d6a5cf53bd3df015d46486537f56ca86a8 (patch) | |
tree | 447f864e7be2d3a8c2b7b33e6a25c3ae293dcff4 /includes/admin/register_db_tables.php | |
parent | affb423909d127f5a1e8ec17b135cc66c9890a75 (diff) | |
download | gigologadmin-098793d6a5cf53bd3df015d46486537f56ca86a8.tar.gz gigologadmin-098793d6a5cf53bd3df015d46486537f56ca86a8.tar.bz2 gigologadmin-098793d6a5cf53bd3df015d46486537f56ca86a8.zip |
Move concert logs creation date to db version 3
Just to make updating easier without having to nuke the db every time.
Diffstat (limited to 'includes/admin/register_db_tables.php')
-rw-r--r-- | includes/admin/register_db_tables.php | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/includes/admin/register_db_tables.php b/includes/admin/register_db_tables.php index 8d9219e..ce1ea07 100644 --- a/includes/admin/register_db_tables.php +++ b/includes/admin/register_db_tables.php @@ -252,7 +252,7 @@ if ( !function_exists( "giglog_register_db_tables") ) function giglog_register_db_tables() { $db_version = get_option('giglogadmin_db_version'); - if ($db_version == 2) { + if ($db_version == 3) { return; } @@ -275,7 +275,6 @@ if ( !function_exists( "giglog_register_db_tables") ) `wpgcl_rev2` varchar(200) DEFAULT NULL, `wpgcl_int` varchar(200) DEFAULT NULL, `wpgcl_status` int(11) DEFAULT 1, - `wpgcl_createddate` date NOT NULL DEFAULT current_timestamp(), PRIMARY KEY (`id`), KEY `wpglog_status` (`wpgcl_status`), KEY `wpglog_concerts` (`wpgcl_concertid`) @@ -407,7 +406,15 @@ if ( !function_exists( "giglog_register_db_tables") ) (6, 'Rejected');"); } - update_option("giglogadmin_db_version", 2); + if ($db_version == NULL || $db_version < 3) + { + $wpdb->query( + "ALTER TABLE `wpg_concertlogs` + ADD COLUMN IF NOT EXISTS + `wpgcl_createddate` date NOT NULL DEFAULT current_timestamp();"); + } + + update_option("giglogadmin_db_version", 3); } giglog_register_db_tables(); |