diff options
author | redmatrix <git@macgirvin.com> | 2016-05-03 18:41:16 -0700 |
---|---|---|
committer | redmatrix <git@macgirvin.com> | 2016-05-03 18:41:16 -0700 |
commit | 3df0bb55221317a17d6e898415ba5d33ede7715d (patch) | |
tree | 776d7ecd467768653e162bc3ee523f2b1566af97 /install | |
parent | dccdeedb75874ac8a244770cc3be0bf9ee71a0cd (diff) | |
download | volse-hubzilla-3df0bb55221317a17d6e898415ba5d33ede7715d.tar.gz volse-hubzilla-3df0bb55221317a17d6e898415ba5d33ede7715d.tar.bz2 volse-hubzilla-3df0bb55221317a17d6e898415ba5d33ede7715d.zip |
some preliminary structural work for app organisation
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_mysql.sql | 4 | ||||
-rw-r--r-- | install/schema_postgres.sql | 4 | ||||
-rw-r--r-- | install/update.php | 19 |
3 files changed, 26 insertions, 1 deletions
diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 2305d4a0b..4751106da 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -123,6 +123,8 @@ CREATE TABLE IF NOT EXISTS `app` ( `app_price` char(255) NOT NULL DEFAULT '', `app_page` char(255) NOT NULL DEFAULT '', `app_requires` char(255) NOT NULL DEFAULT '', + `app_deleted` int(11) NOT NULL DEFAULT '0', + `app_system` int(11) NOT NULL DEFAULT '0', `app_created` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', `app_edited` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', PRIMARY KEY (`id`), @@ -134,6 +136,8 @@ CREATE TABLE IF NOT EXISTS `app` ( KEY `app_channel` (`app_channel`), KEY `app_price` (`app_price`), KEY `app_created` (`app_created`), + KEY `app_deleted` (`app_deleted`), + KEY `app_system` (`app_system`), KEY `app_edited` (`app_edited`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 2c0847cbf..75e53d3dd 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -120,6 +120,8 @@ CREATE TABLE "app" ( "app_price" text NOT NULL DEFAULT '', "app_page" text NOT NULL DEFAULT '', "app_requires" text NOT NULL DEFAULT '', + "app_deleted" smallint NOT NULL DEFAULT '0', + "app_system" smallint NOT NULL DEFAULT '0', "app_created" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', "app_edited" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', PRIMARY KEY ("id") @@ -133,6 +135,8 @@ create index "app_channel" on app ("app_channel"); create index "app_price" on app ("app_price"); create index "app_created" on app ("app_created"); create index "app_edited" on app ("app_edited"); +create index "app_deleted" on app ("app_deleted"); +create index "app_system" on app ("app_system"); CREATE TABLE "attach" ( "id" serial NOT NULL, "aid" bigint NOT NULL DEFAULT '0', diff --git a/install/update.php b/install/update.php index b8e20786c..ea1bd8bc7 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1167 ); +define( 'UPDATE_VERSION' , 1168 ); /** * @@ -2079,4 +2079,21 @@ function update_r1166() { return UPDATE_FAILED; } +function update_r1167() { + $r1 = q("alter table app add app_deleted int not null default '0' "); + $r2 = q("alter table app add app_system int not null default '0' "); + + if(ACTIVE_DBTYPE == DBTYPE_POSTGRES) { + $r3 = q("create index \"app_deleted_idx\" on app (\"app_deleted\") "); + $r4 = q("create index \"app_system_idx\" on app (\"app_system\") "); + } + else { + $r3 = q("alter table app add index ( app_deleted ) "); + $r4 = q("alter table app add index ( app_system ) "); + } + + if($r1 && $r2 && $r3 && $r4) + return UPDATE_SUCCESS; + return UPDATE_FAILED; +} |