{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

aclight - March 17, 2008 - 11:28
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

Here's a patch. UNTESTED.

AttachmentSize
235035_table_drop_1.patch 1.96 KB

#2

aclight - March 20, 2008 - 11:25
Status:needs work» needs review

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.

AttachmentSize
235035_table_drop_2.patch 2.45 KB

#3

aclight - March 26, 2008 - 11:48

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

agentrickard - August 6, 2008 - 13:26

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

AttachmentSize
project_release_uninstall.patch 1.56 KB

#5

aclight - August 6, 2008 - 13:35

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

agentrickard - August 6, 2008 - 17:44

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

#7

aclight - August 9, 2008 - 15:49
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");
-

#8

agentrickard - August 10, 2008 - 20:16

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

Are we patching against DRUPAL-5 or HEAD?

#9

aclight - August 10, 2008 - 20:24

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

#10

agentrickard - August 11, 2008 - 14:30
Status:needs work» needs review

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

AttachmentSize
project_release_uninstall.patch 2.45 KB

#11

aclight - August 11, 2008 - 14:52

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

#12

hunmonk - October 24, 2008 - 03:27
Status:needs review» reviewed & tested by the community
  • 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
AttachmentSize
project_release_uninstall.patch 2.47 KB

#13

hunmonk - October 24, 2008 - 03:34
Status:reviewed & tested by the community» fixed

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

#14

Anonymous (not verified) - November 7, 2008 - 03:41
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.