From f492f808f4861ae9937dcaf3bf8476513ae1c091 Mon Sep 17 00:00:00 2001
From: zotlabs <mike@macgirvin.com>
Date: Fri, 16 Feb 2018 12:42:02 -0800
Subject: refactor of the DB update system. Updates are now stored individually
 in Zotlabs/Update/_nnnn.php and are objects; so only the pending updates need
 to be loaded and executed rather than all historical updates. There is one
 single number (DB_UPDATE_VERSION) representing the current version and it is
 EQUAL TO the last known update. A dummy update _1201 was created to address
 the difference in counting behaviour; it will be executed on the next change
 of DB_UPDATE_VERSION as well as the next update. The database config values
 are also loaded from disk on every update immediately before setting the
 update lock in order to reduce timing conflicts and race conditions.

---
 Zotlabs/Update/_1192.php | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
 create mode 100644 Zotlabs/Update/_1192.php

(limited to 'Zotlabs/Update/_1192.php')

diff --git a/Zotlabs/Update/_1192.php b/Zotlabs/Update/_1192.php
new file mode 100644
index 000000000..f2445da05
--- /dev/null
+++ b/Zotlabs/Update/_1192.php
@@ -0,0 +1,21 @@
+<?php
+
+namespace Zotlabs\Update;
+
+class _1192 {
+function run() {
+
+	if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+		$r1 = q("CREATE INDEX item_obj_type ON item (obj_type)");
+	}
+	else {
+		$r1 = q("ALTER TABLE item ADD INDEX (obj_type)");
+	}
+
+	if($r1)
+		return UPDATE_SUCCESS;
+	return UPDATE_FAILED;
+}
+
+
+}
\ No newline at end of file
-- 
cgit v1.2.3