With Rails/ActiveRecord 2.3.8 I'd like to do:
AnyModel.connection.create_table( 'temp_any_model', temporary: true, id: false, options: 'like any_model' )
But AR insists on adding "()" to the generated SQL even though the field list is blank since the table DDL is being cloned, thus resulting in e.g.:
ActiveRecord::StatementInvalid: Mysql::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') like any_model' at line 1:
CREATE TEMPORARY TABLE `temp_any_model` () like any_model
Is there any way to coerce AR to generate this simple create table
newlike existing
statement?
Besides obviously connection.execute(string)
?