add closeness attribute

This commit is contained in:
friendica 2012-01-31 23:54:53 -08:00
parent 86c0eac27d
commit c0c0f2dc15
4 changed files with 11 additions and 5 deletions

View file

@ -11,7 +11,7 @@ require_once('include/cache.php');
define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_PLATFORM', 'Friendica');
define ( 'FRIENDICA_VERSION', '2.3.1241' ); define ( 'FRIENDICA_VERSION', '2.3.1241' );
define ( 'DFRN_PROTOCOL_VERSION', '2.22' ); define ( 'DFRN_PROTOCOL_VERSION', '2.22' );
define ( 'DB_UPDATE_VERSION', 1118 ); define ( 'DB_UPDATE_VERSION', 1119 );
define ( 'EOL', "<br />\r\n" ); define ( 'EOL', "<br />\r\n" );
define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' ); define ( 'ATOM_TIME', 'Y-m-d\TH:i:s\Z' );

View file

@ -96,6 +96,7 @@ CREATE TABLE IF NOT EXISTS `contact` (
`pending` tinyint(1) NOT NULL DEFAULT '1', `pending` tinyint(1) NOT NULL DEFAULT '1',
`rating` tinyint(1) NOT NULL DEFAULT '0', `rating` tinyint(1) NOT NULL DEFAULT '0',
`reason` text NOT NULL, `reason` text NOT NULL,
`closeness` tinyint(2) NOT NULL DEFAULT '99',
`info` mediumtext NOT NULL, `info` mediumtext NOT NULL,
`profile-id` int(11) NOT NULL DEFAULT '0', `profile-id` int(11) NOT NULL DEFAULT '0',
`bdyear` CHAR( 4 ) NOT NULL COMMENT 'birthday notify flag', `bdyear` CHAR( 4 ) NOT NULL COMMENT 'birthday notify flag',
@ -116,7 +117,8 @@ CREATE TABLE IF NOT EXISTS `contact` (
KEY `blocked` (`blocked`), KEY `blocked` (`blocked`),
KEY `readonly` (`readonly`), KEY `readonly` (`readonly`),
KEY `hidden` (`hidden`), KEY `hidden` (`hidden`),
KEY `pending` (`pending`) KEY `pending` (`pending`),
KEY `closeness` (`closeness`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8; ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
-- -------------------------------------------------------- -- --------------------------------------------------------

View file

@ -278,8 +278,8 @@ function register_post(&$a) {
return; return;
} }
$r = q("INSERT INTO `contact` ( `uid`, `created`, `self`, `name`, `nick`, `photo`, `thumb`, `micro`, `blocked`, `pending`, `url`, `nurl`, $r = q("INSERT INTO `contact` ( `uid`, `created`, `self`, `name`, `nick`, `photo`, `thumb`, `micro`, `blocked`, `pending`, `url`, `nurl`,
`request`, `notify`, `poll`, `confirm`, `poco`, `name-date`, `uri-date`, `avatar-date` ) `request`, `notify`, `poll`, `confirm`, `poco`, `name-date`, `uri-date`, `avatar-date`, `closeness` )
VALUES ( %d, '%s', 1, '%s', '%s', '%s', '%s', '%s', 0, 0, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s' ) ", VALUES ( %d, '%s', 1, '%s', '%s', '%s', '%s', '%s', 0, 0, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', 0 ) ",
intval($newuid), intval($newuid),
datetime_convert(), datetime_convert(),
dbesc($username), dbesc($username),

View file

@ -1,6 +1,6 @@
<?php <?php
define( 'UPDATE_VERSION' , 1118 ); define( 'UPDATE_VERSION' , 1119 );
/** /**
* *
@ -1012,3 +1012,7 @@ INDEX ( `mid` )
} }
function update_1118() {
q("ALTER TABLE `contact` ADD `closeness` TINYINT( 2 ) NOT NULL DEFAULT '99' AFTER `reason` , ADD INDEX (`closensss`) ");
q("update contact set closeness = 0 where self = 1");
}