Another foreign key added

This commit is contained in:
Michael 2020-08-24 21:03:00 +00:00
parent 9113b7e393
commit 88eee2b9c1
3 changed files with 7 additions and 3 deletions

View file

@ -57,9 +57,9 @@ class RepairDatabase
// Add intro entries for pending contacts
// We don't do this for DFRN entries since such revived contact requests seem to mostly fail.
$pending_contacts = DBA::p("SELECT `uid`, `id`, `url`, `network`, `created` FROM `contact`
WHERE `pending` AND `rel` IN (?, ?) AND `network` != ?
WHERE `pending` AND `rel` IN (?, ?) AND `network` != ? AND `uid` != ?
AND NOT EXISTS (SELECT `id` FROM `intro` WHERE `contact-id` = `contact`.`id`)",
0, Contact::FOLLOWER, Protocol::DFRN);
0, Contact::FOLLOWER, Protocol::DFRN, 0);
while ($contact = DBA::fetch($pending_contacts)) {
DBA::insert('intro', ['uid' => $contact['uid'], 'contact-id' => $contact['id'], 'blocked' => false,
'hash' => Strings::getRandomHex(), 'datetime' => $contact['created']]);