set intro::duplex deprecated because of no usage
authorPhilipp <admin@philipp.info>
Thu, 21 Oct 2021 19:48:23 +0000 (21:48 +0200)
committerPhilipp <admin@philipp.info>
Thu, 21 Oct 2021 19:57:24 +0000 (21:57 +0200)
database.sql
doc/database/db_intro.md
src/Contact/Introduction/Depository/Introduction.php
src/Contact/Introduction/Entity/Introduction.php
src/Contact/Introduction/Factory/Introduction.php
static/dbstructure.config.php
tests/src/Contact/Introduction/Factory/IntroductionTest.php

index 178c3fed6fd4aefe6bd5c622b8f52bd4272294cd..fcbcbb3941855e8bded0f03c7b6f500f20364232 100644 (file)
@@ -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 '',
index 0f2e36c70533dbf75bd6f88c26452673ec7287bd..3db6240d035434ef9d3d912264b8f720f0c2331f 100644 (file)
@@ -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 |                |
index b9752d81120ca7ffa19e056ae759cf16319d62a3..792673f23be8411e29f82c5ef259b9f0c24c623a 100644 (file)
@@ -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,
index af9db729aaa92865052c9664a00d132e596d222a..9c5fb060ec4c1728df3c07013b410e43238fe7c6 100644 (file)
@@ -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;
index 57598f5e80c393a74cebf428a37ad68fd47d3417..3bfa166b297e13004c940d7e8c971c149a353464 100644 (file)
@@ -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(),
index 4e478f0342461bcc919a61e72d23ba7845ed73ad..0019fdf7bf5a2567466545fa6673158cf01b3494 100644 (file)
@@ -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" => ""],
index 529d2720efb9a8ba5f333c467a95276cabdb014a..e5efd03ddcbe1422543f8ba5b802d77d34028a29 100644 (file)
@@ -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']);