diff --git a/database.sql b/database.sql index 178c3fed6..fcbcbb394 100644 --- a/database.sql +++ b/database.sql @@ -715,7 +715,7 @@ CREATE TABLE IF NOT EXISTS `intro` ( `contact-id` int unsigned NOT NULL DEFAULT 0 COMMENT '', `suggest-cid` int unsigned COMMENT 'Suggested contact', `knowyou` boolean NOT NULL DEFAULT '0' COMMENT '', - `duplex` boolean NOT NULL DEFAULT '0' COMMENT '', + `duplex` boolean NOT NULL DEFAULT '0' COMMENT 'deprecated', `note` text COMMENT '', `hash` varchar(255) NOT NULL DEFAULT '' COMMENT '', `datetime` datetime NOT NULL DEFAULT '0001-01-01 00:00:00' COMMENT '', diff --git a/doc/database/db_intro.md b/doc/database/db_intro.md index 0f2e36c70..3db6240d0 100644 --- a/doc/database/db_intro.md +++ b/doc/database/db_intro.md @@ -14,7 +14,7 @@ Fields | contact-id | | int unsigned | NO | | 0 | | | suggest-cid | Suggested contact | int unsigned | YES | | NULL | | | knowyou | | boolean | NO | | 0 | | -| duplex | | boolean | NO | | 0 | | +| duplex | deprecated | boolean | NO | | 0 | | | note | | text | YES | | NULL | | | hash | | varchar(255) | NO | | | | | datetime | | datetime | NO | | 0001-01-01 00:00:00 | | diff --git a/src/Contact/Introduction/Depository/Introduction.php b/src/Contact/Introduction/Depository/Introduction.php index b9752d811..792673f23 100644 --- a/src/Contact/Introduction/Depository/Introduction.php +++ b/src/Contact/Introduction/Depository/Introduction.php @@ -71,7 +71,6 @@ class Introduction extends BaseDepository 'contact-id' => $introduction->cid, 'suggest-cid' => $introduction->sid, 'knowyou' => $introduction->knowyou ? 1 : 0, - 'duplex' => $introduction->duplex ? 1 : 0, 'note' => $introduction->note, 'hash' => $introduction->hash, 'ignore' => $introduction->ignore ? 1 : 0, diff --git a/src/Contact/Introduction/Entity/Introduction.php b/src/Contact/Introduction/Entity/Introduction.php index af9db729a..9c5fb060e 100644 --- a/src/Contact/Introduction/Entity/Introduction.php +++ b/src/Contact/Introduction/Entity/Introduction.php @@ -28,7 +28,6 @@ use Friendica\BaseEntity; * @property-read int $cid * @property-read int|null $sid * @property-read bool $knowyou - * @property-read bool $duplex * @property-read string $note * @property-read string $hash * @property-read \DateTime $datetime @@ -45,8 +44,6 @@ class Introduction extends BaseEntity protected $sid; /** @var bool */ protected $knowyou; - /** @var bool */ - protected $duplex; /** @var string */ protected $note; /** @var string */ @@ -63,20 +60,18 @@ class Introduction extends BaseEntity * @param int $cid * @param int|null $sid * @param bool $knowyou - * @param bool $duplex * @param string $note * @param string $hash * @param \DateTime $datetime * @param bool $ignore * @param int|null $id */ - public function __construct(int $uid, int $cid, ?int $sid, bool $knowyou, bool $duplex, string $note, string $hash, \DateTime $datetime, bool $ignore, ?int $id) + public function __construct(int $uid, int $cid, ?int $sid, bool $knowyou, string $note, string $hash, \DateTime $datetime, bool $ignore, ?int $id) { $this->uid = $uid; $this->cid = $cid; $this->sid = $sid; $this->knowyou = $knowyou; - $this->duplex = $duplex; $this->note = $note; $this->hash = $hash; $this->datetime = $datetime; diff --git a/src/Contact/Introduction/Factory/Introduction.php b/src/Contact/Introduction/Factory/Introduction.php index 57598f5e8..3bfa166b2 100644 --- a/src/Contact/Introduction/Factory/Introduction.php +++ b/src/Contact/Introduction/Factory/Introduction.php @@ -39,7 +39,6 @@ class Introduction extends BaseFactory implements ICanCreateFromTableRow $row['contact-id'] ?? 0, $row['suggest-cid'] ?? null, !empty($row['knowyou']), - !empty($row['duplex']), $row['note'] ?? '', $row['hash'] ?? '', new \DateTime($row['datetime'] ?? 'now', new \DateTimeZone('UTC')), @@ -53,15 +52,13 @@ class Introduction extends BaseFactory implements ICanCreateFromTableRow int $cid, string $note, int $sid = null, - bool $knowyou = false, - bool $duplex = false + bool $knowyou = false ): Entity\Introduction { return $this->createFromTableRow([ 'uid' => $uid, 'suggest-cid' => $sid, 'contact-id' => $cid, 'knowyou' => $knowyou, - 'duplex' => $duplex, 'note' => $note, 'hash' => Strings::getRandomHex(), 'datetime' => DateTimeFormat::utcNow(), diff --git a/static/dbstructure.config.php b/static/dbstructure.config.php index 4e478f034..0019fdf7b 100644 --- a/static/dbstructure.config.php +++ b/static/dbstructure.config.php @@ -778,7 +778,7 @@ return [ "contact-id" => ["type" => "int unsigned", "not null" => "1", "default" => "0", "foreign" => ["contact" => "id"], "comment" => ""], "suggest-cid" => ["type" => "int unsigned", "foreign" => ["contact" => "id"], "comment" => "Suggested contact"], "knowyou" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], - "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => ""], + "duplex" => ["type" => "boolean", "not null" => "1", "default" => "0", "comment" => "deprecated"], "note" => ["type" => "text", "comment" => ""], "hash" => ["type" => "varchar(255)", "not null" => "1", "default" => "", "comment" => ""], "datetime" => ["type" => "datetime", "not null" => "1", "default" => DBA::NULL_DATETIME, "comment" => ""], diff --git a/tests/src/Contact/Introduction/Factory/IntroductionTest.php b/tests/src/Contact/Introduction/Factory/IntroductionTest.php index 529d2720e..e5efd03dd 100644 --- a/tests/src/Contact/Introduction/Factory/IntroductionTest.php +++ b/tests/src/Contact/Introduction/Factory/IntroductionTest.php @@ -17,7 +17,6 @@ class IntroductionTest extends TestCase 'suggest-cid' => 13, 'contact-id' => 24, 'knowyou' => 1, - 'duplex' => 1, 'note' => 'a note', 'hash' => '12345', 'datetime' => '1970-01-01 00:00:00', @@ -29,7 +28,6 @@ class IntroductionTest extends TestCase 'suggest-cid' => 13, 'contact-id' => 24, 'knowyou' => true, - 'duplex' => true, 'note' => 'a note', 'hash' => '12345', 'datetime' => new \DateTime('1970-01-01 00:00:00', new \DateTimeZone('UTC')), @@ -45,7 +43,6 @@ class IntroductionTest extends TestCase 'contact-id' => 0, 'suggest-cid' => null, 'knowyou' => false, - 'duplex' => false, 'note' => '', 'ignore' => false, 'id' => null, @@ -61,7 +58,6 @@ class IntroductionTest extends TestCase self::assertEquals($intro->cid, $assertion['contact-id'] ?? 0); self::assertEquals($intro->sid, $assertion['suggest-cid'] ?? null); self::assertEquals($intro->knowyou, $assertion['knowyou'] ?? false); - self::assertEquals($intro->duplex, $assertion['duplex'] ?? false); self::assertEquals($intro->note, $assertion['note'] ?? ''); if (isset($assertion['hash'])) { self::assertEquals($intro->hash, $assertion['hash']);