Method: InstallHstore.up
- Defined in:
- lib/generators/surus/hstore/templates/install_hstore.rb
.up ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/generators/surus/hstore/templates/install_hstore.rb', line 2 def self.up version = ActiveRecord::Base.connection.send(:postgresql_version) # check for newer versions if version >= 90100 sql = "CREATE EXTENSION IF NOT EXISTS hstore" # use the hstore.sql file on the system, if found elsif(path = hstore_sql_path) sql = File.read(path) # run a default hstore.sql else sql = default_sql end execute sql end |