Skip to content

Commit

Permalink
Merge pull request #18 from BlazeIsClone/develop
Browse files Browse the repository at this point in the history
update: script migrate to internal cli
  • Loading branch information
BlazeIsClone authored Oct 1, 2024
2 parents d3b5e96 + c2b5d1e commit 85b37be
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions scripts/migrate.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
#!/bin/bash

export $(grep -v '^#' .env | xargs)

DATABASE_URL="mysql://${MYSQL_USER}:${MYSQL_PASSWORD}@tcp(${MYSQL_HOST}:${MYSQL_PORT})/${MYSQL_DATABASE}"

if [ -z "$1" ]; then
echo "Please provide a migration command (up or down)."
exit 1
fi

migrate -database "$DATABASE_URL" -path internal/database/mysql/migrations "$1"
go run cmd/migrate/main.go

0 comments on commit 85b37be

Please sign in to comment.