Skip to content

Instantly share code, notes, and snippets.

View defenestrator's full-sized avatar

Jeremy Jacob Anderson defenestrator

  • I'm great company.
  • Boise, ID
  • 22:46 (UTC -06:00)
View GitHub Profile
@defenestrator
defenestrator / laravel-forge-deploy.sh
Last active April 22, 2021 18:29 — forked from tonioriol/laravel-forge-deploy.sh
Laravel Forge zero downtime deployment script
# stop script on error signal
set -e
SITE="example.com"
DEPL="/home/forge/deployments/${SITE}"
# create directory and any intermediate directories if don't exist
mkdir -p ${DEPL}
CUR="/home/forge/${SITE}"
NEW="${DEPL}/new"
BKP="${DEPL}/backup"
@defenestrator
defenestrator / laravel_envoyer_migrations_like_a_boss.sh
Last active April 21, 2024 20:08
Laravel Envoyer hook to run migrations in a sane manner
# Application base directory
site= "example.com"
# Navigate to the release being deployed.
cd {{ release }}
# Number of migrations in the new release
releaseMigrations= ls database/migrations | wc -l
# Number of migrations in the current production app
create table my_test_table (
id int not null auto_increment,
my_char_1 char(10), -- A FIXED length string (can contain letters, numbers, and special characters). The size parameter specifies the column length in characters - can be from 0 to 255. Default is 1
my_varchar_1 varchar(50), -- A VARIABLE length string (can contain letters, numbers, and special characters). The size parameter specifies the maximum column length in characters - can be from 0 to 65535
my_binary_1 binary(16), -- Equal to CHAR(), but stores binary byte strings. The size parameter specifies the column length in bytes. Default is 1
my_varbinary_1 varbinary(32), -- Equal to VARCHAR(), but stores binary byte strings. The size parameter specifies the maximum column length in bytes.
my_tinyblob_1 tinyblob, -- For BLOBs (Binary Large