holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r21863: LJSUP-12018: now russian domain have len...

Committer: akanashin
LJSUP-12018: now russian domain have length maximum 16 symbols
U   trunk/bin/deleteusers.pl
U   trunk/bin/upgrading/update-db-general.pl
Modified: trunk/bin/deleteusers.pl
===================================================================
--- trunk/bin/deleteusers.pl	2012-05-02 10:42:16 UTC (rev 21862)
+++ trunk/bin/deleteusers.pl	2012-05-02 11:28:15 UTC (rev 21863)
@@ -147,7 +147,7 @@
     $runsql->($user, "DELETE FROM reluser WHERE targetid=$uid");
     $runsql->($user, "DELETE FROM userlog WHERE userid=$uid");
 
-    $runsql->($user, "UPDATE payitems SET item='domainru_free' WHERE item='domainru' AND rcptid=$uid");
+    $runsql->($user, "DELETE FROM domains WHERE userid=$uid");
     $runsql->($user, "UPDATE user SET statusvis='X', statusvisdate=NOW(), password='' WHERE userid=$uid");
 
 }

Modified: trunk/bin/upgrading/update-db-general.pl
===================================================================
--- trunk/bin/upgrading/update-db-general.pl	2012-05-02 10:42:16 UTC (rev 21862)
+++ trunk/bin/upgrading/update-db-general.pl	2012-05-02 11:28:15 UTC (rev 21863)
@@ -545,10 +545,15 @@
 
 register_tablecreate('domains', <<'EOC');
 CREATE TABLE `domains` (
+  `domainid` int(10) unsigned NOT NULL auto_increment,
   `domain` varchar(80) NOT NULL,
   `userid` int(10) unsigned NOT NULL,
-  PRIMARY KEY (`domain`),
-  KEY `userid` (`userid`)
+  `rcptid` int(10) unsigned NOT NULL,
+  `type` char(5) default NULL,
+  `name` char(80) default NULL,
+  PRIMARY KEY  (`domainid`),
+  KEY `userid` (`userid`),
+  KEY `rcptid` (`userid`)
 )
 EOC
 
@@ -4431,6 +4436,14 @@
                 ADD pic_fb_url VARCHAR(255) NOT NULL DEFAULT ''
         ");
     }
+
+    unless (column_type("domains", "domainid")) {
+            do_alter("domains", "ALTER TABLE domains DROP PRIMARY KEY");
+            do_alter("domains", "ALTER TABLE domains ADD COLUMN domainid int(10) unsigned NOT NULL AUTO_INCREMENT KEY");
+            do_alter("domains", "ALTER TABLE domains ADD COLUMN rcptid int(10) unsigned NOT NULL");
+            do_alter("domains", "ALTER TABLE domains ADD COLUMN type char(5)");
+            do_alter("domains", "ALTER TABLE domains ADD COLUMN name char(80)");
+    }
 });
 
 register_alter(sub {

Tags: akanashin, holyandrew, livejournal, pl
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments