-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/bash | ||
|
||
# List of database names to check | ||
databases=("latiss" "lsstcomcam" "lsstcomcamsim" "startrackerfast" "startrackernarrow" "startrackerwide") # Replace with your actual database names | ||
|
||
# Loop through each database and run Alembic commands | ||
for db_name in "${databases[@]}"; do | ||
echo "Checking Alembic status for database: $db_name" | ||
|
||
echo "Running 'alembic current' for $db_name..." | ||
alembic -n "$db_name" current | ||
echo | ||
echo | ||
echo | ||
|
||
echo "Running 'alembic history' for $db_name..." | ||
alembic -n "$db_name" history | ||
echo | ||
echo "------------------------------------------" | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# List of database names to upgrade and downgrade | ||
databases=("latiss" "lsstcomcam" "lsstcomcamsim" "startrackerfast" "startrackernarrow" "startrackerwide") # Replace with your actual database names | ||
# Loop through each database and perform the sequence of Alembic commands | ||
for db_name in "${databases[@]}"; do | ||
echo "Processing database: $db_name" | ||
|
||
# First upgrade to the latest version | ||
echo "Upgrading $db_name to the latest version..." | ||
alembic -n "$db_name" upgrade head | ||
echo "------------------------------------------" | ||
|
||
# Downgrade by one version | ||
echo "Downgrading $db_name by one version..." | ||
alembic -n "$db_name" downgrade -1 | ||
echo "------------------------------------------" | ||
|
||
# Final upgrade back to the latest version | ||
echo "Upgrading $db_name back to the latest version..." | ||
alembic -n "$db_name" upgrade head | ||
echo "------------------------------------------" | ||
done |