User Tools

Site Tools


buffalo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
buffalo [2020/02/29 21:51] – created adminbuffalo [2020/03/02 22:55] (current) admin
Line 18: Line 18:
  
 Populate new exports ''source ~/.bashrc'' Populate new exports ''source ~/.bashrc''
 +
 +===== PostgreSQL =====
 +
 +Install:
 +
 +<code bash>
 +sudo apt install postgresql
 +</code>
 +
 +Set password (buffalo uses postgres/postgres by default):
 +
 +<code bash>
 +sudo -u postgres psql # Login without password
 +postgres=# \password postgres # Sets the password for user postgres
 +sudo service postgresql restart
 +psql -U postgres -h 127.0.0.1 # Test login, should show password prompt
 +</code>
  
 ===== Create databases ===== ===== Create databases =====
Line 37: Line 54:
 </code> </code>
  
-===== PostgreSQL =====+Undo single migration
  
-Install:+<code bash> 
 +buffalo db migrate down 20200229202131 
 +</code> 
 + 
 +Apply migration
  
 <code bash> <code bash>
-sudo apt install postgresql+buffalo db migrate up 20200229202131
 </code> </code>
  
-Set password (buffalo uses postgres/postgres by default):+===== Set ENV Vars ===== 
 + 
 +Add to ''.env'' file in your project folder:
  
 <code bash> <code bash>
-sudo -u postgres psql # Login without password +ADDR=192.168.178.100 
-postgres=# \password postgres # Sets the password for user postgres +</code> 
-sudo service postgresql restart + 
-psql -U postgres -h 127.0.0.1 # Test login, should show password prompt+===== SQL Migration ===== 
 + 
 +<code bash> 
 + buffalo db generate sql switch_type
 </code> </code>
  
buffalo.1583009469.txt.gz · Last modified: 2020/02/29 21:51 by admin