Topic: How to use RailsOnPg
Dear all,
Today I found this promising plugin that facilitates the creation of certain assets in Postgresql databases. Being able to create foreign keys from a migration would be really useful.
After installing the plugin (which I did using the command rails plugin install since the one suggested at git doesn't work) I created an additional migration with the following content:
class ForeignKeys < ActiveRecord::Migration
def up
add_foreign_key :data_sets, :city_id, :cities
end
def down
remove_foreign_key :data_sets, :city_id, :cities
end
end
Running db:migrate I get the following output:
== ForeignKeys: migrating ====================================================
-- add_foreign_key(:data_sets, :city_id, :cities)
rake aborted!
An error has occurred, this and all later migrations canceled:
undefined method `add_foreign_key' for #<ForeignKeys:0x000000039b6038>
Tasks: TOP => db:migrate
(See full trace by running task with --trace)I'm relatively new to Rails, so my apologies if these questions are basic. It seems the plugin is not functioning or inactive, do I need to do something else apart from the install? Is there some way I can verify this plugin was effectively installed?
Thank you very much.