Create a hstore column
suggest changehstore columns can store settings. PostgreSQL provides them only after the extension is enabled. Call enable_extension on the migration, not inside the create_table block:
class CreatePages < ActiveRecord::Migration[5.0]
def change
enable_extension 'hstore' unless extension_enabled?('hstore')
create_table :pages do |t|
t.hstore :settings
t.timestamps
end
end
end
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents