From f7d3f583180911753aa639faee506f09ef08275d Mon Sep 17 00:00:00 2001 From: Alexei Sorokin Date: Mon, 6 Jul 2020 20:01:16 +0300 Subject: [PATCH] [CORE] Do not set "confirm_address"."user_id" to 0 by default That breaks the foreign key constraint, it is better to just have it nullable. --- classes/Confirm_address.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/classes/Confirm_address.php b/classes/Confirm_address.php index 9bb5ae2b38..46af2b461b 100644 --- a/classes/Confirm_address.php +++ b/classes/Confirm_address.php @@ -24,7 +24,7 @@ class Confirm_address extends Managed_DataObject { public $__table = 'confirm_address'; // table name public $code; // varchar(32) primary_key not_null - public $user_id; // int(4) not_null + public $user_id; // int() public $address; // varchar(191) not_null not 255 because utf8mb4 takes more space public $address_extra; // varchar(191) not_null not 255 because utf8mb4 takes more space public $address_type; // varchar(8) not_null @@ -37,7 +37,7 @@ class Confirm_address extends Managed_DataObject return array( 'fields' => array( 'code' => array('type' => 'varchar', 'length' => 32, 'not null' => true, 'description' => 'good random code'), - 'user_id' => array('type' => 'int', 'default' => 0, 'description' => 'user who requested confirmation'), + 'user_id' => array('type' => 'int', 'description' => 'user who requested confirmation'), 'address' => array('type' => 'varchar', 'length' => 191, 'not null' => true, 'description' => 'address (email, xmpp, SMS, etc.)'), 'address_extra' => array('type' => 'varchar', 'length' => 191, 'description' => 'carrier ID, for SMS'), 'address_type' => array('type' => 'varchar', 'length' => 8, 'not null' => true, 'description' => 'address type ("email", "xmpp", "sms")'),