Skip to content

Instantly share code, notes, and snippets.

@sladebot
Last active December 12, 2015 19:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sladebot/b3e6b9666d918176f2dc to your computer and use it in GitHub Desktop.
Save sladebot/b3e6b9666d918176f2dc to your computer and use it in GitHub Desktop.
sequelize learnings

What are we using :

NPM:

  • pg
  • pg-hstore
  • sequelize
  • sequelize-cli ( for migrations pretty nifty )

So for adding any migrations which has an attribute with a dataType of HSTORE we need to enable it in the Postgresql database ( we need to find a way to automate this - thoughts ? ). Now this seemed to be a nice way so that whenever you create a database it enables HSTORE. Now this worked for me might not work for others.

sudo -u postgres psql template1 -c 'create extension hstore;' create the database with psql sudo -u postgres psql <database_name> -c 'create extension hstore;'

This is nice but there should be an automatic way for doing this ? Lets see ...

Querying

I found this to be very nice : link to gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment