It would be lovely if the rake command db:create
could be followed by a postgresql installation script. This, for example. (It must be run as postgres user):
CREATE EXTENSION "fuzzystrmatch";
This because, in this moment, i'm doing it manually every time I create a database.
Any hints?
Extension Files The file format must be extension_name. control, which tells the basics about extension to PostgreSQL, and must be placed in the installation's SHAREDIR/extension directory.
Description. CREATE EXTENSION loads a new extension into the current database. There must not be an extension of the same name already loaded. Loading an extension essentially amounts to running the extension's script file.
Extensions were implemented in PostgreSQL 9.1 to allow for easier packaging of additions to PostgreSQL. Extensions can package user-visible functions or use hooks in the PostgreSQL to modify how the database does certain processes.
As of Rails 4, there is a enable_extension
method:
class AddFuzzyStringMatching < ActiveRecord::Migration def change enable_extension "fuzzystrmatch" end end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With