The attached patch adds a db_rename function to allow tables to be renamed.

CommentFileSizeAuthor
db_rename.patch1.65 KBdrewish
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nedjo’s picture

+1, this would be a useful addition.

The patch http://drupal.org/node/140860 to get consistent table names in core would use this.

MySQL supports a RENAME TABLE syntax. Is the ALTER TABLE syntax used in the patch equally supported?

drewish’s picture

good question. it is supported by both mysql 4.1 and 5.0+. i've found it supported for postgresql versions back to 7.3.

bjaspan’s picture

Status: Needs review » Reviewed & tested by the community

This is a good addition to the API. Tested on MySQL and PostgresQL, works fine.

Dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)