holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[ljcom] r11600: LJSUP-11372: Develop regional self promo...

Committer: akanashin
LJSUP-11372: Develop regional self promo for Ukraine
U   trunk/bin/upgrading/update-db-local.pl
Modified: trunk/bin/upgrading/update-db-local.pl
===================================================================
--- trunk/bin/upgrading/update-db-local.pl	2012-03-16 14:45:42 UTC (rev 11599)
+++ trunk/bin/upgrading/update-db-local.pl	2012-03-19 08:54:51 UTC (rev 11600)
@@ -1107,7 +1107,7 @@
   `active` int(11) NOT NULL DEFAULT '1',
   `finished` int(11) NOT NULL DEFAULT '0',
   `type` enum('entry','journal','community') NOT NULL DEFAULT 'entry',
-  `country` enum('cyr','ua') NOT NULL DEFAULT 'cyr',
+  `country` char(3) NOT NULL DEFAULT 'cyr',
   PRIMARY KEY (`promoid`),
   KEY `type_promoid_index` (`type`,`promoid`)
 )
@@ -2397,11 +2397,17 @@
         );
     }
 
-    unless (column_type('selfpromo', 'country')) {
+    $type_column = column_type('selfpromo', 'country');
+    if ($type_column eq "" ) {
         do_alter(
             'selfpromo',
-            "ALTER TABLE selfpromo ADD COLUMN country enum('cyr','ua') NOT NULL DEFAULT 'cyr'",
+            "ALTER TABLE selfpromo ADD COLUMN country char(3) NOT NULL DEFAULT 'cyr'",
         );
+    } elsif ( $type_column !~ /cyr/i ) {
+        do_alter(
+            'selfpromo',
+            "ALTER TABLE selfpromo MODIFY COLUMN country char(3) NOT NULL DEFAULT 'cyr'",
+        );
     }
 
     unless (column_type("userapps", "userhead")) {

Tags: akanashin, holyandrew, ljcom, 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