At the bottom of project_release_update_5200(), there is this:

  // 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.

Comments

aclight’s picture

Title: {project_release_default_versions} table is not dropped » {project_release_default_versions} table is not dropped in update 5200
Priority: Normal » Minor
Status: Active » Needs work
StatusFileSize
new1.96 KB

Here's a patch. UNTESTED.

aclight’s picture

Status: Needs work » Needs review
StatusFileSize
new2.45 KB

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.

aclight’s picture

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.

agentrickard’s picture

StatusFileSize
new1.56 KB

db_drop_table() is a D6-only function. This should work. Patch is written from project module root. Is that the preferred method?

aclight’s picture

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.

agentrickard’s picture

THis is probably RTBC, though I do not have pgsql running. The syntax is copied from system.install.

aclight’s picture

Status: Needs review » Needs work

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");
-
agentrickard’s picture

I can only assume that the version I'm using is incorrect.

Are we patching against DRUPAL-5 or HEAD?

aclight’s picture

HEAD, though in this case I would assume they are the same as HEAD is for D5 still and not D6.

agentrickard’s picture

Status: Needs work » Needs review
StatusFileSize
new2.45 KB

Fixed. (I simply forgot to remove that part.)

aclight’s picture

the mysql part looks good to me. i don't have a pgsql installation to test with, however.

hunmonk’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new2.47 KB
  • removed the clunky code comments and replaced w/ doxygen
  • added $ret = array(); at the top -- prevents errors in the case where no queries are run
  • tested as working on pgsql
hunmonk’s picture

Status: Reviewed & tested by the community » Fixed

tested mysql as well, works beautifully. committed to 5.x and HEAD. thanks!

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.