diff options
author | redmatrix <redmatrix@redmatrix.me> | 2015-09-28 04:15:21 -0700 |
---|---|---|
committer | redmatrix <redmatrix@redmatrix.me> | 2015-09-28 04:15:21 -0700 |
commit | edbcba6f113a5c8b709cdbfca892e845b5096ede (patch) | |
tree | b66d328d5f4c77c9d7d0bdcd704c72639e22a8b7 | |
parent | ed876a9c529f59fa62bb45805aa4f355fe0e2c0d (diff) | |
download | volse-hubzilla-edbcba6f113a5c8b709cdbfca892e845b5096ede.tar.gz volse-hubzilla-edbcba6f113a5c8b709cdbfca892e845b5096ede.tar.bz2 volse-hubzilla-edbcba6f113a5c8b709cdbfca892e845b5096ede.zip |
schema support for additional site types
-rwxr-xr-x | boot.php | 8 | ||||
-rw-r--r-- | install/schema_mysql.sql | 4 | ||||
-rw-r--r-- | install/schema_postgres.sql | 2 | ||||
-rw-r--r-- | install/update.php | 11 |
4 files changed, 22 insertions, 3 deletions
@@ -50,7 +50,7 @@ define ( 'PLATFORM_NAME', 'hubzilla' ); define ( 'RED_VERSION', trim(file_get_contents('version.inc')) . 'H'); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1155 ); +define ( 'DB_UPDATE_VERSION', 1156 ); /** * @brief Constant with a HTML line break. @@ -333,6 +333,12 @@ define ( 'MENU_ITEM_ZID', 0x0001); define ( 'MENU_ITEM_NEWWIN', 0x0002); define ( 'MENU_ITEM_CHATROOM', 0x0004); + + +define ( 'SITE_TYPE_ZOT', 0); +define ( 'SITE_TYPE_NOTZOT', 1); +define ( 'SITE_TYPE_UNKNOWN', 2); + /** * Poll/Survey types */ diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index c78259e41..0e626752d 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -1131,6 +1131,7 @@ CREATE TABLE IF NOT EXISTS `site` ( `site_realm` char(255) NOT NULL DEFAULT '', `site_valid` smallint NOT NULL DEFAULT '0', `site_dead` smallint NOT NULL DEFAULT '0', + `site_type` smallint NOT NULL DEFAULT '0', PRIMARY KEY (`site_url`), KEY `site_flags` (`site_flags`), KEY `site_update` (`site_update`), @@ -1141,7 +1142,8 @@ CREATE TABLE IF NOT EXISTS `site` ( KEY `site_pull` (`site_pull`), KEY `site_realm` (`site_realm`), KEY `site_valid` (`site_valid`), - KEY `site_dead` (`site_dead`) + KEY `site_dead` (`site_dead`), + KEY `site_type` (`site_type`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `source` ( diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 6145e9ccb..f378a3e3d 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -1122,6 +1122,7 @@ CREATE TABLE "site" ( "site_realm" text NOT NULL DEFAULT '', "site_valid" smallint NOT NULL DEFAULT '0', "site_dead" smallint NOT NULL DEFAULT '0', + "site_type" smallint NOT NULL DEFAULT '0', PRIMARY KEY ("site_url") ); create index "site_flags" on site ("site_flags"); @@ -1133,6 +1134,7 @@ create index "site_sellpage" on site ("site_sellpage"); create index "site_realm" on site ("site_realm"); create index "site_valid" on site ("site_valid"); create index "site_dead" on site ("site_dead"); +create index "site_type" on site ("site_type"); CREATE TABLE "source" ( "src_id" serial NOT NULL, diff --git a/install/update.php b/install/update.php index 9f4457600..059d69d14 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1155 ); +define( 'UPDATE_VERSION' , 1156 ); /** * @@ -1875,3 +1875,12 @@ function update_r1154() { } + +function update_r1155() { + + $r1 = q("alter table site add site_type smallint not null default '0' "); + $r2 = q("create index site_type on site ( site_type ) "); + if($r1 && $r2) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} |