summaryrefslogtreecommitdiffstats
path: root/includes
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-04-07 10:09:36 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-04-07 10:09:36 +0200
commit098793d6a5cf53bd3df015d46486537f56ca86a8 (patch)
tree447f864e7be2d3a8c2b7b33e6a25c3ae293dcff4 /includes
parentaffb423909d127f5a1e8ec17b135cc66c9890a75 (diff)
downloadgigologadmin-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')
-rw-r--r--includes/admin/register_db_tables.php13
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();