1

Attempting to migrate the Discourse database, but 20120921162512_add_meta_data_to_forum_threads.rb seems to produce the following error:

== 20120921162512 AddMetaDataToForumThreads: migrating ========================
-- execute("CREATE EXTENSION IF NOT EXISTS hstore")
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::InvalidParameterValue: ERROR:  version to install must be specified
: CREATE EXTENSION IF NOT EXISTS hstore/usr/home/www/_myapp/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `async_exec'
/usr/home/www/_myapp/vendor/bundle/ruby/2.2.0/gems/activerecord-4.1.10/lib/active_record/connection_adapters/postgresql/database_statements.rb:128:in `block in execute'
...
Flynt Hamlock
  • 349
  • 2
  • 12

1 Answers1

0

The easiest way to solve this issue is by having your default Postgres template database already have the hstore extension installed, like this:

psql -d template1 -c 'create extension hstore;'

See this answer for a great, thorough explanation: https://stackoverflow.com/a/11584751/483260

Community
  • 1
  • 1
natchiketa
  • 5,867
  • 2
  • 28
  • 25