From cb283be0714bf732daa35ec1c080aaf2c07da732 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 23 May 2011 16:40:48 -0400 Subject: [PATCH] Add registered_user_id column to invitation It's valuable for us to know which, if any, invitations have been converted. --- classes/Invitation.php | 1 + classes/statusnet.ini | 1 + db/core.php | 3 +++ 3 files changed, 5 insertions(+) diff --git a/classes/Invitation.php b/classes/Invitation.php index 0e87c1629c..83625b3932 100644 --- a/classes/Invitation.php +++ b/classes/Invitation.php @@ -14,6 +14,7 @@ class Invitation extends Memcached_DataObject public $user_id; // int(4) not_null public $address; // varchar(255) multiple_key not_null public $address_type; // varchar(8) multiple_key not_null + public $registered_user_id; // int(4) not_null public $created; // datetime() not_null /* Static get */ diff --git a/classes/statusnet.ini b/classes/statusnet.ini index bdf96c1ddc..017c4dd58e 100644 --- a/classes/statusnet.ini +++ b/classes/statusnet.ini @@ -258,6 +258,7 @@ user_id = 129 address = 130 address_type = 130 created = 142 +registered_user_id = 129 [invitation__keys] code = K diff --git a/db/core.php b/db/core.php index 10d8e51b9b..f8e4af9843 100644 --- a/db/core.php +++ b/db/core.php @@ -542,14 +542,17 @@ $schema['invitation'] = array( 'address' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'invitation sent to'), 'address_type' => array('type' => 'varchar', 'length' => 8, 'not null' => true, 'description' => 'address type ("email", "xmpp", "sms")'), 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'), + 'registered_user_id' => array('type' => 'int', 'not null' => true, 'description' => 'if the invitation is converted, who the new user is'), ), 'primary key' => array('code'), 'foreign keys' => array( 'invitation_user_id_fkey' => array('user', array('user_id' => 'id')), + 'invitation_registered_user_id_fkey' => array('user', array('registered_user_id' => 'id')), ), 'indexes' => array( 'invitation_address_idx' => array('address', 'address_type'), 'invitation_user_id_idx' => array('user_id'), + 'invitation_registered_user_id_idx' => array('registered_user_id'), ), );