File tree Expand file tree Collapse file tree 4 files changed +24
-25
lines changed Expand file tree Collapse file tree 4 files changed +24
-25
lines changed Original file line number Diff line number Diff line change 1+ --
2+ -- PostgreSQL database dump
3+ --
4+
5+ -- Dumped from database version 15.8
6+ -- Dumped by pg_dump version 15.8
7+
18SET statement_timeout = 0 ;
29SET lock_timeout = 0 ;
310SET idle_in_transaction_session_timeout = 0 ;
@@ -1004,8 +1011,3 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
10041011-- PostgreSQL database dump complete
10051012--
10061013
1007-
1008- --
1009- -- Dbmate schema migrations
1010- --
1011-
Original file line number Diff line number Diff line change 1+ --
2+ -- PostgreSQL database dump
3+ --
4+
5+ -- Dumped from database version 17.4
6+ -- Dumped by pg_dump version 17.4
7+
18SET statement_timeout = 0 ;
29SET lock_timeout = 0 ;
310SET idle_in_transaction_session_timeout = 0 ;
@@ -991,8 +998,3 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
991998-- PostgreSQL database dump complete
992999--
9931000
994-
995- --
996- -- Dbmate schema migrations
997- --
998-
Original file line number Diff line number Diff line change 1+ --
2+ -- PostgreSQL database dump
3+ --
4+
5+ -- Dumped from database version 17.0
6+ -- Dumped by pg_dump version 17.0
7+
18SET statement_timeout = 0 ;
29SET lock_timeout = 0 ;
310SET idle_in_transaction_session_timeout = 0 ;
@@ -1005,8 +1012,3 @@ CREATE EVENT TRIGGER pgrst_drop_watch ON sql_drop
10051012-- PostgreSQL database dump complete
10061013--
10071014
1008-
1009- --
1010- -- Dbmate schema migrations
1011- --
1012-
Original file line number Diff line number Diff line change @@ -187,17 +187,10 @@ perform_dump() {
187187 local attempt=1
188188
189189 while [ $attempt -le $max_attempts ]; do
190- echo " Attempting dbmate dump (attempt $attempt /$max_attempts )"
190+ echo " Attempting pg_dump (attempt $attempt /$max_attempts )"
191191
192- # Run dbmate dump
193- if dbmate dump; then
194- # Post-process schema.sql to remove schema_migrations INSERT statements
195- if [ -f " db/schema.sql" ]; then
196- # Remove INSERT INTO schema_migrations lines
197- sed -i ' /^INSERT INTO schema_migrations/d' db/schema.sql
198- echo " Schema dump completed successfully (schema_migrations data removed)"
199- return 0
200- fi
192+ if " ${PSQLBIN} /pg_dump" -h localhost -p " $PORTNO " -U " $PGSQL_SUPERUSER " -d postgres --schema-only --no-owner --no-privileges > " ./db/schema.sql" ; then
193+ return 0
201194 fi
202195
203196 echo " Dump attempt $attempt failed, waiting before retry..."
You can’t perform that action at this time.
0 commit comments