diff options
Diffstat (limited to 'install')
-rw-r--r-- | install/schema_postgres.sql | 15 | ||||
-rw-r--r-- | install/update.php | 20 |
2 files changed, 26 insertions, 9 deletions
diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 70a7a576a..95ed9acb7 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -44,7 +44,6 @@ CREATE TABLE "abook" ( create index "abook_profile" on abook ("abook_profile"); create index "abook_dob" on abook ("abook_dob"); create index "abook_connected" on abook ("abook_connected"); - create index "abook_rating" on abook ("abook_rating"); create index "abook_channel_closeness" on abook ("abook_channel", "abook_closeness"); CREATE TABLE "account" ( @@ -342,8 +341,8 @@ create index "conv_created_idx" on conv ("created"); create index "conv_updated_idx" on conv ("updated"); CREATE TABLE IF NOT EXISTS "dreport" ( - "dreport_id" int(11) NOT NULL, - "dreport_channel" int(11) NOT NULL DEFAULT '0', + "dreport_id" int NOT NULL, + "dreport_channel" int NOT NULL DEFAULT '0', "dreport_mid" char(255) NOT NULL DEFAULT '', "dreport_site" char(255) NOT NULL DEFAULT '', "dreport_recip" char(255) NOT NULL DEFAULT '', @@ -388,7 +387,7 @@ CREATE TABLE "event" ( "deny_gid" text NOT NULL, "event_status" char(255) NOT NULL DEFAULT '', "event_status_date" timestamp NOT NULL DEFAULT '0001-01-01 00:00:00', - "event_percent" smallint(6) NOT NULL DEFAULT '0', + "event_percent" smallint NOT NULL DEFAULT '0', "event_repeat" text NOT NULL, "event_sequence" smallint NOT NULL DEFAULT '0', "event_priority" smallint NOT NULL DEFAULT '0', @@ -623,7 +622,7 @@ CREATE TABLE "item" ( "item_retained" smallint NOT NULL DEFAULT '0', "item_rss" smallint NOT NULL DEFAULT '0', "item_deleted" smallint NOT NULL DEFAULT '0', - "item_type" int(11) NOT NULL DEFAULT '0', + "item_type" int NOT NULL DEFAULT '0', "item_hidden" smallint NOT NULL DEFAULT '0', "item_unpublished" smallint NOT NULL DEFAULT '0', "item_delayed" smallint NOT NULL DEFAULT '0', @@ -918,11 +917,11 @@ CREATE TABLE "photo" ( "data" bytea NOT NULL, "scale" numeric(3) NOT NULL, "profile" numeric(1) NOT NULL DEFAULT '0', - "photo_usage" smallint(6) NOT NULL DEFAULT '0', + "photo_usage" smallint NOT NULL DEFAULT '0', "is_nsfw" smallint NOT NULL DEFAULT '0', "os_storage" smallint NOT NULL DEFAULT '0', - "os_path" mediumtext NOT NULL, - "display_path" mediumtext NOT NULL, + "os_path" text NOT NULL, + "display_path" text NOT NULL, "photo_flags" bigint NOT NULL DEFAULT '0', "allow_cid" text NOT NULL, "allow_gid" text NOT NULL, diff --git a/install/update.php b/install/update.php index 38e76afda..10ae6725e 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@ <?php -define( 'UPDATE_VERSION' , 1159 ); +define( 'UPDATE_VERSION' , 1160 ); /** * @@ -1932,3 +1932,21 @@ function update_r1158() { } +function update_r1159() { + $r = q("select attach.id, attach.data, attach.hash, channel_address from attach left join channel on attach.uid = channel_id where os_storage = 1 "); + if($r) { + foreach($r as $rr) { + $x = dbunescbin($rr['data']); + $has_slash = (($x === 'store/' . $rr['channel_address'] . '/') ? true : false); + if(($x === 'store/' . $rr['channel_address']) || ($has_slash)) { + q("update attach set data = '%s' where id = %d", + dbesc('store/' . $rr['channel_address']. (($has_slash) ? '' : '/' . $rr['hash'])), + dbesc($rr['id']) + ); + } + } + } + return UPDATE_SUCCESS; +} + + |