feat(legacy): helpers: allow HECTIC_NAMESPACE be empty
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#
|
||||
# first migration
|
||||
#
|
||||
#!/bin/dash
|
||||
|
||||
HECTIC_NAMESPACE=test-create-migration
|
||||
|
||||
log notice "case: ${WHITE}first migration"
|
||||
if ! migrator create; then
|
||||
log error "test failed: error on migration creation"
|
||||
exit 1
|
||||
@@ -17,10 +18,7 @@ if [ "$(find ./migration -maxdepth 1 -type f | wc -l)" -eq 0 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# next migration
|
||||
#
|
||||
|
||||
log notice "case: ${WHITE}next migration"
|
||||
if ! migrator create; then
|
||||
log error "test failed: error on migration creation"
|
||||
exit 1
|
||||
@@ -31,10 +29,7 @@ if [ "$(find ./migration -maxdepth 1 -type f | wc -l)" -eq 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# migration with custom name
|
||||
#
|
||||
|
||||
log notice "case: ${WHITE}migration with custom name"
|
||||
if ! migrator create --name test; then
|
||||
log error "test failed: error on migration creation"
|
||||
exit 1
|
||||
@@ -50,10 +45,7 @@ if ! find ./migration -maxdepth 1 -type f -name '*test.sql' \
|
||||
log eror "test failed: migration have unexpected name"
|
||||
fi
|
||||
|
||||
#
|
||||
# migration with custom name that contains space
|
||||
#
|
||||
|
||||
log notice "case: ${WHITE}migration with custom name that contains space"
|
||||
if ! migrator create --name 'test name'; then
|
||||
log error "test failed: error on migration creation"
|
||||
exit 1
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/dash
|
||||
|
||||
HECTIC_NAMESPACE=test-init-migrator
|
||||
|
||||
log info "hectic.migration table inheritance"
|
||||
if ! migration_table_sql="$(migrator --inherits tablename --inherits 'table name' init --dry-run)"; then
|
||||
log error "test failed: error on migration table init dry run"
|
||||
@@ -1,3 +1,7 @@
|
||||
#!/bin/dash
|
||||
|
||||
HECTIC_NAMESPACE=test-migration-list
|
||||
|
||||
psql "$DATABASE_URL" 'CREATE TABLE profile (
|
||||
id INTEGER,
|
||||
username TEXT
|
||||
|
||||
@@ -1 +1,5 @@
|
||||
#!/bin/dash
|
||||
|
||||
HECTIC_NAMESPACE=test-migration-list
|
||||
|
||||
#migrator list
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
#!/bin/dash
|
||||
|
||||
HECTIC_NAMESPACE=test-missing-psql
|
||||
|
||||
# remove psql from $PATH
|
||||
dir=$(dirname -- "$(command -v psql)")
|
||||
PATH=$(printf '%s' "$PATH" | awk -v RS=: -v ORS=: -v d="$dir" '$0!=d{print}')
|
||||
Reference in New Issue
Block a user