rake db aborted
Closed this issue · 1 comments
class CreateTypes < ActiveRecord::Migration[5.1]
def change
create_table :types do |t|
t.float :code, limit:5
t.float :subcode, limit:6
t.string :description, limit:60
t.timestamps null: false
end
end
end
class CreateOccurrences < ActiveRecord::Migration[5.1]
def change
create_table :occurrences do |t|
t.types :references
t.users :references
t.date :date_of_occurrence
t.date :date_of_registry
t.timestamp :hour
t.string :origin
t.text :description
t.string :expert
t.string :expert_assistance
t.boolean :memo
t.integer :requisition_number
t.integer :year
t.string :authority
t.boolean :local_closed
t.boolean :location_foundd
t.string :address
t.boolean :eletronic_annex
t.string :reference
t.text :observation
t.string :definitive_request
t.timestamps
end
end
end
When i do the commando rails db:migrate an error happened like this:
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:
NoMethodError: undefined method `types' for #ActiveRecord::ConnectionAdapters::PostgreSQL::TableDefinition:0x00007ff5bdc6d8a0
Con you help-me to fix this?? rails 5.1.4
t.types :references
Should be
t.references :types