Ticket #3707: better_init_scheme_info_errors.diff
| File better_init_scheme_info_errors.diff, 1.2 kB (added by pezra@barelyenough.org, 2 years ago) |
|---|
-
activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
old new 221 221 def structure_dump 222 222 end 223 223 224 # Should not be called normally, but this operation is non-destructive. 224 # Creates the schema_info table in preparation for using 225 # ActiveRecord::Migration. Obviously, this should not be 226 # called normally, but this operation is non-destructive. 225 227 # The migrations module handles this automatically. 226 228 def initialize_schema_information 227 229 begin 230 execute "SELECT COUNT(*) from #{ActiveRecord::Migrator.schema_info_table_name}" 231 rescue ActiveRecord::StatementInvalid 228 232 execute "CREATE TABLE #{ActiveRecord::Migrator.schema_info_table_name} (version #{type_to_sql(:integer)})" 229 233 execute "INSERT INTO #{ActiveRecord::Migrator.schema_info_table_name} (version) VALUES(0)" 230 rescue ActiveRecord::StatementInvalid231 # Schema has been intialized232 234 end 233 235 end 234 236