mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
fix: pre-create index on partitioned table to unblock dev setup (#325)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
c236287977
commit
e7652c8a56
@@ -130,6 +130,14 @@ if [[ ! -f "${SCHEMA_FILE}" ]]; then
|
||||
warn "No schema.sql found at ${SCHEMA_FILE}. Skipping."
|
||||
else
|
||||
if [[ -x "${PGSCHEMA}" ]]; then
|
||||
# pgschema uses CREATE INDEX CONCURRENTLY for new indexes, which Postgres
|
||||
# does not support on partitioned tables. Pre-create any such indexes here
|
||||
# so pgschema sees them as already existing and skips the CONCURRENTLY path.
|
||||
log "Pre-creating indexes on partitioned tables (if needed)..."
|
||||
docker exec sprout-postgres psql -U "${PGUSER}" -d "${PGDATABASE}" -q -c \
|
||||
"CREATE INDEX IF NOT EXISTS idx_events_parameterized ON events (kind, pubkey, d_tag, deleted_at) WHERE d_tag IS NOT NULL;" \
|
||||
2>/dev/null || true
|
||||
|
||||
log "Using pgschema for migrations..."
|
||||
attempts=0
|
||||
max_attempts=10
|
||||
|
||||
Reference in New Issue
Block a user