Makefile 572 B

123456789101112131415161718192021222324252627
  1. #.EXPORT_ALL_VARIABLES:
  2. #export DB_USER=postgres
  3. #export DB_PASSWORD=password
  4. #export DB_NAME=flowy
  5. #export DB_PORT=5433
  6. #export DATABASE_URL=postgres://${DB_USER}:${DB_PASSWORD}@localhost:${DB_PORT}/${DB_NAME}
  7. #export DB_HOST = "localhost"
  8. init_database:
  9. ${ROOT}/init_database.sh
  10. reset_db:
  11. #diesel database reset
  12. sqlx database reset
  13. add_migrations:
  14. #make table="the name of your table" add_migrations
  15. # diesel migration generation $(table)
  16. sqlx migrate add $(table)
  17. run_migrations:
  18. # diesel migration run
  19. sqlx migrate run
  20. echo_db_url:
  21. echo ${DATABASE_URL}