r24472 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r24471‎ | r24472 | r24473 >
Date:17:56, 30 July 2007
Author:aaron
Status:old
Tags:
Comment:
*Add acr_deleted to make a real b-tree, should make indexes less retarded. This should be the last random schema change as I'll be marking this as 'stable' soon.
Modified paths:
  • /trunk/extensions/ConfirmAccount/ConfirmAccount.pg.sql (modified) (history)
  • /trunk/extensions/ConfirmAccount/ConfirmAccount.sql (modified) (history)
  • /trunk/extensions/ConfirmAccount/ConfirmAccount_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/ConfirmAccount.sql
@@ -38,6 +38,9 @@
3939
4040 -- Timestamp of account registration.
4141 acr_registration char(14) NOT NULL,
 42+
 43+ -- Flag for rejected accounts
 44+ acr_deleted bool NOT NULL,
4245 -- Time of rejection (if rejected)
4346 acr_rejected binary(14),
4447 -- The user who rejected it
@@ -46,5 +49,5 @@
4750 PRIMARY KEY (acr_id),
4851 UNIQUE KEY (acr_name),
4952 INDEX (acr_email_token),
50 - INDEX acr_rejected_reg (acr_rejected,acr_registration)
 53+ INDEX acr_deleted_reg (acr_deleted,acr_registration)
5154 ) TYPE=InnoDB;
\ No newline at end of file
Index: trunk/extensions/ConfirmAccount/ConfirmAccount.pg.sql
@@ -18,11 +18,12 @@
1919 acr_notes TEXT,
2020 acr_urls TEXT,
2121 acr_ip CIDR,
 22+ acr_deleted BOOL NOT NULL,
2223 acr_rejected TIMESTAMPTZ,
2324 acr_user INTEGER REFERENCES mwuser(user_id) ON DELETE SET NULL
2425 );
2526
26 -CREATE INDEX acr_rejected_reg ON account_requests (acr_rejected,acr_registration);
 27+CREATE INDEX acr_deleted_reg ON account_requests (acr_deleted,acr_registration);
2728 CREATE INDEX acr_email_token ON account_requests (acr_email_token);
2829
2930 COMMIT;
Index: trunk/extensions/ConfirmAccount/ConfirmAccount_body.php
@@ -437,8 +437,10 @@
438438 global $wgUser;
439439 # Request can later be recovered
440440 $dbw->update( 'account_requests',
441 - array( 'acr_rejected' => wfTimestampNow(), 'acr_user' => $wgUser->getID() ),
442 - array( 'acr_id' => $this->acrID, 'acr_rejected IS NULL' ),
 441+ array( 'acr_rejected' => wfTimestampNow(),
 442+ 'acr_user' => $wgUser->getID(),
 443+ 'acr_deleted' => 1 ),
 444+ array( 'acr_id' => $this->acrID, 'acr_deleted' => 0 ),
443445 __METHOD__ );
444446 } else {
445447 $dbw->delete( 'account_requests', array('acr_id' => $this->acrID), __METHOD__ );
@@ -733,9 +735,9 @@
734736 $this->mForm = $form;
735737 $this->mConds = $conds;
736738 if( $rejects )
737 - $this->mConds[] = 'acr_rejected IS NOT NULL';
 739+ $this->mConds['acr_deleted'] = 1;
738740 else
739 - $this->mConds[] = 'acr_rejected IS NULL';
 741+ $this->mConds['acr_deleted'] = 0;
740742 $this->rejects = $rejects;
741743 parent::__construct();
742744 }

Status & tagging log