]> git.openstreetmap.org Git - rails.git/blobdiff - lib/migrate.rb
1st amf_controller tests, and some basic sanity check fixes
[rails.git] / lib / migrate.rb
index 68ff04615b48b4a3eee3cd90aaa3fd39c1da8d34..585b47b1ca624d7bfc2cad06f7dd24432cb8857f 100644 (file)
@@ -45,6 +45,10 @@ module ActiveRecord
         types[:bigint] = { :name => "bigint", :limit => 20 }
         types[:double] = { :name => "double" }
         types[:bigint_pk] = { :name => "bigint(20) DEFAULT NULL auto_increment PRIMARY KEY" }
+        types[:bigint_pk_64] = { :name => "bigint(64) DEFAULT NULL auto_increment PRIMARY KEY" }
+        types[:bigint_auto_64] = { :name => "bigint(64) DEFAULT NULL auto_increment" }
+        types[:bigint_auto_11] = { :name => "bigint(11) DEFAULT NULL auto_increment" }
+        types[:bigint_auto_20] = { :name => "bigint(20) DEFAULT NULL auto_increment" }
         types
       end
 
@@ -69,6 +73,18 @@ module ActiveRecord
       def innodb_table
         return { :id => false, :force => true, :options => "ENGINE=InnoDB" }
       end
+
+      def innodb_option
+        return "ENGINE=InnoDB"
+      end
+      def change_engine (table_name, engine)
+        execute "ALTER TABLE #{table_name} ENGINE = #{engine}"
+      end
+
+      def add_fulltext_index (table_name, column)
+        execute "CREATE FULLTEXT INDEX `#{table_name}_#{column}_idx` ON `#{table_name}` (`#{column}`)"
+      end
     end
   end
 end