Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

chore: prod sqlx command to check what migrations are needed (#824)

Will Hutchinsondc528c2a5543
diff --git a/rust/cloud-storage/macro_db_client/justfile b/rust/cloud-storage/macro_db_client/justfile
index 4e508176a6..7dc72ce2e2 100644
--- a/rust/cloud-storage/macro_db_client/justfile
+++ b/rust/cloud-storage/macro_db_client/justfile
@@ -33,6 +33,14 @@ setup_prepare:
reset_db:
just sqlx::reset_db {{ DATABASE_URL }}
+check_db_dev:
+ just sqlx::check_db $(../scripts/rds_database_url.sh macro-db-dev macrodb-password-dev macrodb)
+
+check_db_prod:
+ #!/usr/bin/env bash
+ echo -e "\033[33mChecking pending migrations on PRODUCTION database...\033[0m"
+ just sqlx::check_db $(../scripts/rds_database_url.sh macro-db-prod macrodb-password-prod macrodb)
+
migrate_db_dev:
DATABASE_URL=$(../scripts/rds_database_url.sh macro-db-dev macrodb-password-dev macrodb) sqlx migrate run
diff --git a/rust/cloud-storage/sqlx.just b/rust/cloud-storage/sqlx.just
index 5dc7da5f4a..1b38d10f8e 100644
--- a/rust/cloud-storage/sqlx.just
+++ b/rust/cloud-storage/sqlx.just
@@ -2,6 +2,10 @@
create_db $DATABASE_URL:
cargo sqlx database create
+[no-cd]
+check_db $DATABASE_URL:
+ sqlx migrate info
+
[no-cd]
migrate_db $DATABASE_URL:
cargo sqlx migrate run