{project_release_default_versions} table is not dropped in update 5200
aclight - March 16, 2008 - 20:34
| Project: | Project |
| Version: | 5.x-1.x-dev |
| Component: | Releases |
| Category: | bug report |
| Priority: | minor |
| Assigned: | Unassigned |
| Status: | closed |
Description
At the bottom of project_release_update_5200(), there is this:
<?php
// Finally, drop the stale table and column.
// While testing the upgrade path, these are both commented out for now:
//$ret[] = update_sql('DROP TABLE {project_release_default_versions}');
//$ret[] = update_sql("ALTER TABLE {project_release_projects} DROP snapshot_table");
?>I'm guessing that these lines need to be uncommented, and now we need another update function that checks to see if the table exists and drops it, since sites that have already upgraded to project 5.x-1.2 won't get the benefit of having these tables dropped if we just uncomment these lines and commit.

#1
Here's a patch. UNTESTED.
#2
Here's an updated patch which puts both of the queries in a conditional. I figured this was best just in case an astute project_release module user happened to see the queries to drop the table and column commented out in update 5200 and manually removed the table and column.
Tested pretty thoroughly using MySQL, but the pgSQL case could use testing and reveiw.
#3
Just as a note, before this fix and update are applied, (especially to d.o), we need #235037: Critical errors in project_page_overview() query and logic to get fixed, because otherwise the project overview pages will throw database errors.
#4
db_drop_table() is a D6-only function. This should work. Patch is written from project module root. Is that the preferred method?
#5
Good catch. Yeah, we typically roll project* patches from the root directory of the main module, even if the patch is to a module that has its own subdirectory.
#6
THis is probably RTBC, though I do not have pgsql running. The syntax is copied from system.install.
#7
Was there a reason you left this part out of the patch?
- // Finally, drop the stale table and column.- // While testing the upgrade path, these are both commented out for now:
- //$ret[] = update_sql('DROP TABLE {project_release_default_versions}');
- //$ret[] = update_sql("ALTER TABLE {project_release_projects} DROP snapshot_table");
-
#8
I can only assume that the version I'm using is incorrect.
Are we patching against DRUPAL-5 or HEAD?
#9
HEAD, though in this case I would assume they are the same as HEAD is for D5 still and not D6.
#10
Fixed. (I simply forgot to remove that part.)
#11
the mysql part looks good to me. i don't have a pgsql installation to test with, however.
#12
$ret = array();at the top -- prevents errors in the case where no queries are run#13
tested mysql as well, works beautifully. committed to 5.x and HEAD. thanks!
#14
Automatically closed -- issue fixed for two weeks with no activity.