Skip to content

Instantly share code, notes, and snippets.

View GideonBrimleaf's full-sized avatar

Chris GideonBrimleaf

View GitHub Profile
@GideonBrimleaf
GideonBrimleaf / update_date_column.sql
Created October 9, 2020 12:06
Setting a default column value to current timestamp
--The double column name reference is required
ALTER TABLE table_name CHANGE date_column_name date_column_name TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP;
@GideonBrimleaf
GideonBrimleaf / alpas_prod.sh
Last active June 16, 2020 16:25
Alpas migration script for small servers
#!/usr/bin/env bash
#Based off alpas.sh by ashokgelal which is available here https://gist.github.com/ashokgelal/c569e2df7e296378c8becce1c8680f31
#Include this in the root of your project - then on Heroku you can enter `heroku run ./run_prod.sh db:migrate` to run the migrations if the environment you are on is short on space
runApp() {
MY_PATH=$(dirname "$0")
MY_PATH=$( (cd "$MY_PATH" && pwd))
APP_PATH="${MY_PATH}"