Skip to content

Instantly share code, notes, and snippets.

@piferdg
Last active October 5, 2018 16:53
Show Gist options
  • Save piferdg/bd60e9ceacea245e3313faa0cd17bf05 to your computer and use it in GitHub Desktop.
Save piferdg/bd60e9ceacea245e3313faa0cd17bf05 to your computer and use it in GitHub Desktop.
Deploying knex/express to heroku

Deploying Knex databases to heroku/help for drills:

  • Git init
  • Create repo in git hub and use the second set of command line code(git add remote origin stuff)
  • Create a git ignore
  • Git add, git commit"first commit", git push -u origin master
  • Npm intstall
  • Npm intstall knex
  • Npm install pg
  • Createdb (create a database and name it after the createdb command)
  • Knex init
  • YOU NEED TO MAKE SOME ADJUSTMENTS IN YOUR KNEXJS FILE!!!! OR ERRORS!!!!
  • Knex migrate:make (name)
  • Knex seed:make (name)
  • Knex migrate:latest
  • Knex seed:run
  • psql (database name)
  • (Select * from (table name))
  • Nodemon
  • Git add, commit and push
  • DO ALL YOUR SHIT ON YOUR FILES!!!
  • Push and commit all your work
  • Create a heroku app
  • Copy the third line down(heroku git:remote -a (appName))
  • Git remote -v
  • Git push heroku master
  • Heroku addons:create heroku-postgresql:hobby-dev
  • Git push heroku master
  • heroku run knex migrate:latest
  • Heroku run knex seed:run
  • Commit any changes to git hub
  • Push them to git hub
  • Git push heroku master
  • :)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment