aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xboot.php6
-rw-r--r--install/schema_mysql.sql2
-rw-r--r--install/schema_postgres.sql2
-rw-r--r--install/update.php19
4 files changed, 25 insertions, 4 deletions
diff --git a/boot.php b/boot.php
index c3036b6d7..fec908ce0 100755
--- a/boot.php
+++ b/boot.php
@@ -48,7 +48,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '1.7.1' );
define ( 'ZOT_REVISION', 1.1 );
-define ( 'DB_UPDATE_VERSION', 1168 );
+define ( 'DB_UPDATE_VERSION', 1169 );
/**
@@ -691,7 +691,7 @@ function startup() {
class ZotlabsAutoloader {
static public function loader($className) {
$filename = str_replace('\\', '/', $className) . ".php";
- if (file_exists($filename)) {
+ if(file_exists($filename)) {
include($filename);
if (class_exists($className)) {
return TRUE;
@@ -702,7 +702,7 @@ class ZotlabsAutoloader {
if(! $arr[0])
$arr = array_shift($arr);
$filename = 'addon/' . lcfirst($arr[0]) . '/' . $arr[1] . ((count($arr) === 2) ? '.php' : '/' . $arr[2] . ".php");
- if (file_exists($filename)) {
+ if(file_exists($filename)) {
include($filename);
if (class_exists($className)) {
return TRUE;
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql
index 4751106da..a674ab8c4 100644
--- a/install/schema_mysql.sql
+++ b/install/schema_mysql.sql
@@ -883,6 +883,7 @@ CREATE TABLE IF NOT EXISTS `obj` (
`obj_imgurl` char(255) NOT NULL DEFAULT '',
`obj_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`obj_edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `obj_quantity` int(11) NOT NULL DEFAULT '0',
`allow_cid` mediumtext NOT NULL,
`allow_gid` mediumtext NOT NULL,
`deny_cid` mediumtext NOT NULL,
@@ -897,6 +898,7 @@ CREATE TABLE IF NOT EXISTS `obj` (
KEY `obj_imgurl` (`obj_imgurl`),
KEY `obj_created` (`obj_created`),
KEY `obj_edited` (`obj_edited`),
+ KEY `obj_quantity` (`obj_quantity`),
KEY `obj_obj` (`obj_obj`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql
index 75e53d3dd..e2c078dc1 100644
--- a/install/schema_postgres.sql
+++ b/install/schema_postgres.sql
@@ -873,6 +873,7 @@ CREATE TABLE "obj" (
"obj_imgurl" char(255) NOT NULL DEFAULT '',
"obj_created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
"obj_edited" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00',
+ "obj_quantity" int(11) NOT NULL DEFAUL '0'.
"allow_cid" text NOT NULL,
"allow_gid" text NOT NULL,
"deny_cid" text NOT NULL,
@@ -890,6 +891,7 @@ create index "obj_url" on obj ("obj_url");
create index "obj_imgurl" on obj ("obj_imgurl");
create index "obj_created" on obj ("obj_created");
create index "obj_edited" on obj ("obj_edited");
+create index "obj_quantity" on obj ("obj_quantity");
CREATE TABLE "outq" (
"outq_hash" text NOT NULL,
diff --git a/install/update.php b/install/update.php
index ea1bd8bc7..983db1bb9 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,6 +1,6 @@
<?php
-define( 'UPDATE_VERSION' , 1168 );
+define( 'UPDATE_VERSION' , 1169 );
/**
*
@@ -2097,3 +2097,20 @@ function update_r1167() {
return UPDATE_SUCCESS;
return UPDATE_FAILED;
}
+
+function update_r1168() {
+
+ $r1 = q("alter table obj add obj_quantity int not null default '0' ");
+
+ if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) {
+ $r2 = q("create index \"obj_quantity_idx\" on obj (\"obj_quantity\") ");
+ }
+ else {
+ $r2 = q("alter table obj add index ( obj_quantity ) ");
+ }
+
+ if($r1 && $r2)
+ return UPDATE_SUCCESS;
+ return UPDATE_FAILED;
+}
+