Don't create unnecessary table

webappl - April 17, 2008 - 19:37
Project:Pathauto
Version:5.x-2.1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

If you install Pathauto, then uninstall completely, then install again, you will be getting error that MySQL can not create table since it is already exist.
Suggestion:
Installation procedure should check on existence for this table first and give a warning not an error.

#1

greggles - April 19, 2008 - 19:46
Title:Get error after install, uninstall and install again» Properly delete table on uninstall

I think we should just properly delete the table during the uninstall.

Which database and version do you use? I only ask in case that is part of the problem.

#2

webappl - April 21, 2008 - 22:25

I'm using MySQL 5.0.32.
I don't think that it is part of the problem at all.
You do whatever you feel right just make sure that when you delete this table the old content with aliases created by your module will still accessible.
BTW, it is very needed feature to make path sound appropriate for content. Thank you for module.

#3

greggles - April 22, 2008 - 12:01

I agree, I do not think that your DB could be the problem. I test on MySQL most of the timeand wanted to make sure this was not a problem between the query and pgsql.

Thanks.

#4

greggles - April 26, 2008 - 23:21
Status:active» needs review

Since we don't use this table any more this could either drop the table or stop making it. So, I decided that Pathauto should stop making this table.

AttachmentSize
248031-pathauto-4-stop_creating_table.patch 2.58 KB

#5

greggles - April 26, 2008 - 23:34
Title:Properly delete table on uninstall» Don't create unnecessary table

Better title

#6

greggles - April 26, 2008 - 23:38

And slightly better - if people have the table let's delete it on uninstall.

AttachmentSize
248031-pathauto-6-stop_creating_table.patch 3 KB

#7

greggles - May 4, 2008 - 23:06
Status:needs review» fixed

And fixed in 5.x and HEAD. Thanks for reporting this, webappl!

#8

Freso - May 5, 2008 - 15:23
Status:fixed» needs work

Another thing to do might be to make an _update() that removes the table, so people upgrading from earlier versions that installed the table (whether or not it was used) have the table removed? (Thus removing database cruft.)

#9

greggles - May 5, 2008 - 15:41
Status:needs work» fixed

Well, I added code to remove it in the uninstall. I think I'll still need that table some day and plan to figure out how to best use/modify it then.

#10

Freso - May 5, 2008 - 16:03
Status:fixed» needs review

Wouldn't it be better to remove the table now, and reintroduce it later when(/if) it turns out you need it anyway. AFAICT, the module isn't even creating the table anywhere, so people who have the table, got it from some old (and outdated) code. Should it turn out you need it later, surely it would be best if you could start from scratch without having to make sure people who never uninstalled the module have their table updater properly?

By the way, attached are a patch for D5 and a patch for D6, moving the table dropping to pathauto_update_7().

AttachmentSize
pathauto_one_table_smaller.d5.patch 1.25 KB
pathauto_one_table_smaller.d6.patch 1.16 KB

#11

greggles - May 6, 2008 - 12:35
Status:needs review» fixed

Fixed in both 5.x and HEAD. Thanks, Freso!

#12

Anonymous (not verified) - May 20, 2008 - 12:43
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.