| 222 | ==== Migration Error recovery ==== |
| 223 | * Error: "Unknown column \'gis_location.lon_min\' in \'field list\'" |
| 224 | * Cause: MySQL didn't have the field, model did & the migration log in databases\ said that the migration had happened. |
| 225 | To recover: |
| 226 | {{{ |
| 227 | vim /etc/crontab |
| 228 | #0-59/1 * * * * www-data cd /home/haiti/web2py/ && python web2py.py -C -D 1 >> /tmp/cron.output 2>&1 |
| 229 | |
| 230 | ln -sf /etc/apache2/sites-available/test-maintain /etc/apache2/sites-enabled/test |
| 231 | /etc/init.d/apache2 force-reload |
| 232 | |
| 233 | http://haiti-test.sahanafoundation.org/phpmyadmin/index.php?db=haititest&table=gis_location |
| 234 | Export as SQL |
| 235 | |
| 236 | rm -f /home/haiti/test/databases/a54f35709b0d09d927454f2b745571db_gis_location.table |
| 237 | |
| 238 | mysql |
| 239 | \r haititest |
| 240 | drop TABLE gis_location; |
| 241 | \q |
| 242 | |
| 243 | vim /home/haiti/test/models/00_db.py |
| 244 | migrate=True |
| 245 | ln -sf /etc/apache2/sites-available/uat /etc/apache2/sites-enabled/test |
| 246 | /etc/init.d/apache2 force-reload |
| 247 | |
| 248 | http://haiti-test.sahanafoundation.org/test/ |
| 249 | |
| 250 | http://haiti-test.sahanafoundation.org/phpmyadmin/index.php?db=haititest&table=gis_location |
| 251 | Import SQL |
| 252 | |
| 253 | vim /etc/crontab |
| 254 | 0-59/1 * * * * www-data cd /home/haiti/web2py/ && python web2py.py -C -D 1 >> /tmp/cron.output 2>&1 |
| 255 | |
| 256 | vim /home/haiti/test/models/00_db.py |
| 257 | migrate=False |
| 258 | }}} |
| 259 | |