[Jifty-commit] r1014 - in jifty/trunk: lib/Jifty

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat May 6 16:05:14 EDT 2006


Author: alexmv
Date: Sat May  6 16:05:14 2006
New Revision: 1014

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/Upgrade.pm

Log:
 r12858 at zoq-fot-pik:  chmrr | 2006-05-06 16:04:13 -0400
  * Be a little more explicit about SQLite's limitation, and a possible
    (painful) workaround


Modified: jifty/trunk/lib/Jifty/Upgrade.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Upgrade.pm	(original)
+++ jifty/trunk/lib/Jifty/Upgrade.pm	Sat May  6 16:05:14 2006
@@ -83,9 +83,14 @@
     if ($args{column}) {
         my $driver = Jifty->config->framework('Database')->{'Driver'};
         if ($driver eq "SQLite") {
-            # SQLite doesn't support renaming columns -- cruel hack to
-            # just add the new name
-            die "SQLite does not support table renaming.  We are sad!";
+            # It's possible to work around this, but it's a PITA that
+            # I haven't figured out all of the details of.  It
+            # involves creating a temporary table that's a duplicate
+            # of the current table, copying the data over, dropping
+            # the original table, recreating it with the column
+            # renamed, transferring the data back, and then dropping
+            # the temporary table.  Painful enough for ya?
+            die "SQLite does not support renaming columns in tables.  We are sad!";
         } else {
             Jifty->handle->simple_query("ALTER TABLE $args{table} RENAME $args{column} TO $args{to}");
         }


More information about the Jifty-commit mailing list