From ac4688eac087854bf8cb0c893d7a79052ad63a20 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Fri, 27 May 2016 23:57:47 -0700 Subject: allow objs to represent inventory --- boot.php | 6 +++--- install/schema_mysql.sql | 2 ++ install/schema_postgres.sql | 2 ++ install/update.php | 19 ++++++++++++++++++- 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 @@