|  | 
| 29 | 29 |  * | 
| 30 | 30 |  * Database migration assertions to test during WebTestOfUpgradeDatabase | 
| 31 | 31 |  */ | 
| 32 |  | -$LATEST_VERSION = '2.0-beta.8'; | 
| 33 |  | -$TOTAL_MIGRATION_COUNT = 252; | 
|  | 32 | +$LATEST_VERSION = '2.0-beta.9'; | 
|  | 33 | +$TOTAL_MIGRATION_COUNT = 293; | 
| 34 | 34 | 
 | 
| 35 | 35 | $MIGRATIONS = array( | 
| 36 | 36 |     /* beta 0.1 */ | 
|  | 
| 268 | 268 |     '0.9' => array( | 
| 269 | 269 |         'zip_url' => 'https://thinkup.com/downloads/thinkup-0.9.zip', | 
| 270 | 270 |         'migrations' => 1, | 
| 271 |  | -        'setup_sql' => array( | 
| 272 |  | -                      "INSERT INTO tu_plugins (name, folder_name) VALUES ('Flickr Thumbnails', 'flickthumbnails');"), | 
|  | 271 | +        'setup_sql' => array("INSERT INTO tu_plugins (name, folder_name, is_active) VALUES ('Flickr Thumbnails', ". | 
|  | 272 | +                " 'flickthumbnails', 1);"), | 
| 273 | 273 |         'migration_assertions' => array( | 
| 274 | 274 |             'sql' => array( | 
| 275 | 275 |                 array( | 
|  | 
| 366 | 366 |     '0.12' => array( | 
| 367 | 367 |         'zip_url' => 'https://thinkup.com/downloads/thinkup-0.12.1.zip', | 
| 368 | 368 |         'migrations' => 1, | 
| 369 |  | -        'setup_sql' => array("INSERT INTO tu_plugins (name, folder_name) VALUES ('Embed Thread', 'embedthread');"), | 
|  | 369 | +        'setup_sql' => array("INSERT INTO tu_plugins (name, folder_name, is_active) VALUES ('Embed Thread', ". | 
|  | 370 | +        "'embedthread', 1);"), | 
| 370 | 371 |         'migration_assertions' => array( | 
| 371 | 372 |             'sql' => array( | 
| 372 | 373 |                 array( | 
|  | 
| 1046 | 1047 | 
 | 
| 1047 | 1048 |      /* 2.0-beta.8 */ | 
| 1048 | 1049 |     '2.0-beta.8' => array( | 
| 1049 |  | -        'zip_url' => 'file://./build/thinkup.zip', | 
|  | 1050 | +        'zip_url' => 'https://thinkup.com/downloads/beta/thinkup-2.0-beta.8.zip', | 
| 1050 | 1051 |         'migrations' => 0, | 
| 1051 |  | -     ) | 
|  | 1052 | +    ), | 
| 1052 | 1053 | 
 | 
|  | 1054 | +     /* 2.0-beta.9 */ | 
|  | 1055 | +    '2.0-beta.9' => array( | 
|  | 1056 | +        'zip_url' => 'file://./build/thinkup.zip', | 
|  | 1057 | +        'migrations' => 0, | 
|  | 1058 | +        'migration_assertions' => array( | 
|  | 1059 | +            'sql' => array( | 
|  | 1060 | +                array( | 
|  | 1061 | +                    // Add tu_users.is_verified field | 
|  | 1062 | +                    'query' => 'DESCRIBE tu_users is_verified;', | 
|  | 1063 | +                    'match' => "/tinyint\(1\)/", | 
|  | 1064 | +                    'column' => 'Type', | 
|  | 1065 | +                ), | 
|  | 1066 | +                array( | 
|  | 1067 | +                    // Create tu_count_history table | 
|  | 1068 | +                    'query' => 'DESCRIBE tu_count_history count;', | 
|  | 1069 | +                    'match' => "/int\(11\)/", | 
|  | 1070 | +                    'column' => 'Type', | 
|  | 1071 | +                ), | 
|  | 1072 | +                array( | 
|  | 1073 | +                    // Drop tu_follower_count table | 
|  | 1074 | +                    'query' => "SHOW TABLES LIKE 'tu_follower_count'", // table is dropped;', | 
|  | 1075 | +                    'no_match' => true | 
|  | 1076 | +                ), | 
|  | 1077 | +                array( | 
|  | 1078 | +                    // Add tu_count_history index network_user_id | 
|  | 1079 | +                    'query' => "SHOW INDEX FROM tu_count_history WHERE Key_name = 'network_user_id' and Column_name = ". | 
|  | 1080 | +                    "'network_user_id' and Non_unique = 1;", | 
|  | 1081 | +                    'match' => "/network_user_id/", | 
|  | 1082 | +                    'column' => 'Key_name', | 
|  | 1083 | +                ), | 
|  | 1084 | +                array( | 
|  | 1085 | +                    // Add tu_count_history index on post_id | 
|  | 1086 | +                    'query' => "SHOW INDEX FROM tu_count_history WHERE Key_name = 'post_id' and Column_name = ". | 
|  | 1087 | +                    "'post_id' and Non_unique = 1;", | 
|  | 1088 | +                    'match' => "/post_id/", | 
|  | 1089 | +                    'column' => 'Key_name', | 
|  | 1090 | +                ), | 
|  | 1091 | +                array( | 
|  | 1092 | +                    // Add tu_count_history index on date | 
|  | 1093 | +                    'query' => "SHOW INDEX FROM tu_count_history WHERE Key_name = 'date' and Column_name = ". | 
|  | 1094 | +                    "'date' and Non_unique = 1;", | 
|  | 1095 | +                    'match' => "/date/", | 
|  | 1096 | +                    'column' => 'Key_name', | 
|  | 1097 | +                ), | 
|  | 1098 | +                array( | 
|  | 1099 | +                    // Add tu_instances_twitter.last_reply_id | 
|  | 1100 | +                    'query' => "DESCRIBE tu_instances_twitter last_reply_id;", | 
|  | 1101 | +                    'match' => "/varchar\(80\)/", | 
|  | 1102 | +                    'column' => 'Type', | 
|  | 1103 | +                ), | 
|  | 1104 | +                array( | 
|  | 1105 | +                    // Drop tu_instances_twitter.last_page_fetched_tweets | 
|  | 1106 | +                    'query' => "DESCRIBE tu_instances_twitter last_page_fetched_tweets;", | 
|  | 1107 | +                    'no_match' => true | 
|  | 1108 | +                ), | 
|  | 1109 | +                array( | 
|  | 1110 | +                    // Drop tu_instances_twitter.last_page_fetched_replies | 
|  | 1111 | +                    'query' => "DESCRIBE tu_instances_twitter last_page_fetched_replies;", | 
|  | 1112 | +                    'no_match' => true | 
|  | 1113 | +                ), | 
|  | 1114 | +                array( | 
|  | 1115 | +                    // Add tu_owners.api_key_private | 
|  | 1116 | +                    'query' => "DESCRIBE tu_owners api_key_private;", | 
|  | 1117 | +                    'match' => "/varchar\(32\)/", | 
|  | 1118 | +                    'column' => 'Type', | 
|  | 1119 | +                ), | 
|  | 1120 | +                array( | 
|  | 1121 | +                    // Add tu_owners.email_notification_frequency | 
|  | 1122 | +                    'query' => "DESCRIBE tu_owners email_notification_frequency;", | 
|  | 1123 | +                    'match' => "/varchar\(10\)/", | 
|  | 1124 | +                    'column' => 'Type', | 
|  | 1125 | +                ), | 
|  | 1126 | +                array( | 
|  | 1127 | +                    // Create tu_photos table | 
|  | 1128 | +                    'query' => 'DESCRIBE tu_photos id;', | 
|  | 1129 | +                    'match' => "/int\(11\)/", | 
|  | 1130 | +                    'column' => 'Type', | 
|  | 1131 | +                ), | 
|  | 1132 | +                array( | 
|  | 1133 | +                    // Add tu_posts.permalink field | 
|  | 1134 | +                    'query' => "DESCRIBE tu_posts permalink;", | 
|  | 1135 | +                    'match' => "/text/", | 
|  | 1136 | +                    'column' => 'Type', | 
|  | 1137 | +                ), | 
|  | 1138 | +                array( | 
|  | 1139 | +                    // Rename insights.prefix to headline field | 
|  | 1140 | +                    'query' => "DESCRIBE tu_insights headline;", | 
|  | 1141 | +                    'match' => "/varchar\(255\)/", | 
|  | 1142 | +                    'column' => 'Type', | 
|  | 1143 | +                ), | 
|  | 1144 | +                array( | 
|  | 1145 | +                    // Rename insights.prefix to headline field | 
|  | 1146 | +                    'query' => "DESCRIBE tu_insights prefix;", | 
|  | 1147 | +                    'no_match' => true, | 
|  | 1148 | +                ), | 
|  | 1149 | +                array( | 
|  | 1150 | +                    // Add insights.header_image | 
|  | 1151 | +                    'query' => "DESCRIBE tu_insights header_image;", | 
|  | 1152 | +                    'match' => "/varchar\(255\)/", | 
|  | 1153 | +                    'column' => 'Type', | 
|  | 1154 | +                ), | 
|  | 1155 | +            ) | 
|  | 1156 | +        ) | 
|  | 1157 | +    ) | 
| 1053 | 1158 | ); | 
0 commit comments