mirror of
https://gh.wpcy.net/https://github.com/fairpm/aspirecloud.git
synced 2026-06-20 02:22:28 +08:00
15 lines
576 B
Bash
Executable file
15 lines
576 B
Bash
Executable file
#!/bin/bash
|
|
here=$(dirname "$0") && source "$here"/_prelude.bash
|
|
|
|
. .env
|
|
[[ -r .env.testing ]] && . .env.testing
|
|
|
|
export APP_ENV=testing
|
|
export DB_CONNECTION=test
|
|
|
|
export PGPASSWORD=$DB_ROOT_PASSWORD
|
|
psql -U "$DB_ROOT_USERNAME" -h "$DB_HOST" -c 'drop database if exists aspirecloud_testing'
|
|
psql -U "$DB_ROOT_USERNAME" -h "$DB_HOST" -c "create database aspirecloud_testing owner $DB_USERNAME"
|
|
psql -U "$DB_ROOT_USERNAME" -h "$DB_HOST" -c "create extension if not exists pg_trgm"
|
|
php artisan migrate --database=test --force --no-interaction
|
|
php artisan db:seed --database=test
|