tasks/database.rake in rubyrep-1.1.1 vs tasks/database.rake in rubyrep-1.1.2
- old
+ new
@@ -269,10 +269,19 @@
# Neccessary to create tables with dots in ActiveRecord 2.3.5
def connection.extract_pg_identifier_from_name(name)
return name, nil
end
+ create_table :table_with_strange_key, :id => false do |t|
+ t.column STRANGE_COLUMN, :integer
+ end
+
+ ActiveRecord::Base.connection.execute(<<-end_sql)
+ ALTER TABLE table_with_strange_key ADD CONSTRAINT table_with_strange_key_pkey
+ PRIMARY KEY (#{ActiveRecord::Base.connection.quote_column_name(STRANGE_COLUMN)})
+ end_sql
+
create_table STRANGE_TABLE do |t|
t.column :first_fk, :integer
t.column :second_fk, :integer
t.column STRANGE_COLUMN, :string
end
@@ -328,9 +337,10 @@
ActiveRecord::Base.establish_connection config
ActiveRecord::Schema.define do
drop_table :rr_referencing rescue nil
drop_table :rr_duplicate rescue nil
+ drop_table :table_with_strange_key rescue nil
drop_table STRANGE_TABLE rescue nil
drop_table :extender_type_check rescue nil
drop_table :extender_no_record rescue nil
drop_table :extender_one_record rescue nil
drop_table :extender_without_key rescue nil
\ No newline at end of file