Skip to content

Commit b3bf99a

Browse files
committed
fix: tmp use this working branch for flakeurl
1 parent f174eee commit b3bf99a

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,10 +153,10 @@ jobs:
153153
- name: Update Dockerfile.dbmate version
154154
run: |
155155
sed -i 's/%VERSION%/${{ env.PGMAJOR }}/g' migrations/Dockerfile.dbmate
156-
156+
#TODO PR Convert to develop branch flakeurl
157157
- name: verify schema.sql is committed
158158
run: |
159-
sudo nix run github:supabase/postgres#dbmate-tool -- --version ${{ env.PGMAJOR }}
159+
sudo nix run github:supabase/postgres/sam/dbmate-schemas#dbmate-tool -- --version ${{ env.PGMAJOR }}
160160
if ! git diff --exit-code --quiet migrations/schema-${{ env.PGMAJOR }}.sql; then
161161
echo "Detected changes in schema.sql:"
162162
git diff migrations/schema-${{ env.PGMAJOR }}.sql

nix/tools/dbmate-tool.sh.in

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -153,24 +153,11 @@ trim_schema() {
153153
;;
154154
esac
155155
}
156-
migrate_version() {
157-
overmind kill || true
158-
rm -f .overmind.sock Procfile || true
159-
PSQLBIN=$(nix build --no-link "$FLAKE_URL#psql_$PSQL_VERSION/bin" --json | jq -r '.[].outputs.out + "/bin"')
160-
echo "Using PostgreSQL version $PSQL_VERSION from $PSQLBIN"
161-
162-
# Create Procfile
163-
cat > Procfile << EOF
156+
overmind_start() {
157+
cat > Procfile << EOF
164158
postgres_${PSQL_VERSION}: exec nix run "$FLAKE_URL#start-server" "$PSQL_VERSION"
165159
EOF
166-
167-
echo "Starting PostgreSQL server with: exec nix run $FLAKE_URL#start-server $PSQL_VERSION"
168-
cat Procfile
169-
170-
# Start services with Overmind
171-
overmind start -D
172-
173-
160+
overmind start -D
174161
echo "Waiting for overmind socket..."
175162
max_wait=5
176163
count=0
@@ -185,6 +172,16 @@ EOF
185172
sleep 1
186173
count=$((count + 1))
187174
done
175+
}
176+
migrate_version() {
177+
overmind kill || true
178+
rm -f .overmind.sock Procfile || true
179+
PSQLBIN=$(nix build --no-link "$FLAKE_URL#psql_$PSQL_VERSION/bin" --json | jq -r '.[].outputs.out + "/bin"')
180+
echo "Using PostgreSQL version $PSQL_VERSION from $PSQLBIN"
181+
182+
# Start overmind
183+
overmind_start
184+
echo "Waiting for overmind socket..."
188185

189186

190187
echo "Waiting for PostgreSQL to be ready..."

0 commit comments

Comments
 (0)