@@ -95,7 +95,7 @@ help: ## Show this help
9595#  Migration name variable (use with: make atlas-diff-all name=add_new_feature)
9696NAME  ?= $(shell  date +% Y% m% d% H% M% S) 
9797
98- .PHONY : atlas-install atlas-diff-all atlas-apply-all atlas-lint-all atlas-hash-all
98+ .PHONY : atlas-install atlas-diff-all atlas-plan atlas- apply-all atlas-lint-all atlas-hash-all
9999
100100#  Install Atlas CLI and GORM provider
101101atlas-install : # # Install Atlas CLI and GORM provider
@@ -104,6 +104,20 @@ atlas-install: ## Install Atlas CLI and GORM provider
104104	@go install ariga.io/atlas-provider-gorm@latest
105105	@echo " ✅ Atlas tools installed successfully" 
106106
107+ #  Preview migration changes without generating files
108+ atlas-plan : # # Preview what migrations would be generated (use: make atlas-plan name=my_change)
109+ 	@echo " Previewing migration changes for all databases..." 
110+ 	@if [ -z  " $( filter-out $( NAME)  ,$( shell date +%Y%m%d%H%M%S) ) "   ];  then  \ 
111+ 		echo  " ⚠️  Using auto-generated name: $( NAME) " ;  \ 
112+ 		echo  " 💡 Tip: Use 'make atlas-plan name=descriptive_name' for better naming" ;  \ 
113+ 	fi 
114+ 	@echo " \n🔐 Generating checksums for existing migrations..." 
115+ 	@$(MAKE )  atlas-hash-all
116+ 	@echo " \n📊 PostgreSQL (dry-run)..."   &&  atlas migrate diff $(NAME )  --env postgres --dry-run ||  true 
117+ 	@echo " \n📊 MySQL (dry-run)..."   &&  atlas migrate diff $(NAME )  --env mysql --dry-run ||  true 
118+ 	@echo " \n📊 SQLite (dry-run)..."   &&  atlas migrate diff $(NAME )  --env sqlite --dry-run ||  true 
119+ 	@echo " \n✅ Preview complete (no files generated)" 
120+ 
107121#  Generate migrations for all database dialects (Postgres, MySQL, SQLite)
108122atlas-diff-all : # # Generate migrations for all databases (use: make atlas-diff-all name=my_change)
109123	@echo " Generating migrations for all databases..." 
0 commit comments