fix: cleanup_schema now drops functions for public schema cleanup#5
Open
fix: cleanup_schema now drops functions for public schema cleanup#5
Conversation
added 2 commits
January 7, 2026 05:05
Previously, cleanup_schema() only dropped tables, which left stored procedures orphaned when using the public schema. This was problematic because: 1. When using public schema, DROP SCHEMA CASCADE never runs (safety check) 2. Only the tables were dropped by cleanup_schema() 3. Stored procedures accumulated across test runs This fix adds DROP FUNCTION IF EXISTS for all 22 stored procedures, ensuring complete cleanup regardless of which schema is used. Fixes #4
- Fixed cleanup_schema to drop stored procedures (issue #4) - Fixed prune_executions_bulk to process Running instances - Updated duroxide dependency to 0.1.11 - Added schema versioning documentation - Added regression test for prune bulk behavior
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes #4 -
cleanup_schema()now drops all stored procedures in addition to tables, ensuring complete cleanup when using the public schema.Problem
When using the public schema (default), the
cleanup_schema()function only dropped tables, leaving stored procedures orphaned. This happened because:cleanup_schema()SQL function only hadDROP TABLEstatementsDROP SCHEMA CASCADEon public schemaChanges
Modified
migrations/0002_create_stored_procedures.sql:DROP FUNCTION IF EXISTSfor all 22 stored procedures insidecleanup_schema()Testing
postgres_provider_testpassNotes
This aligns
duroxide-pgwith the pattern already used induroxide-pg-opt, which has comprehensive function drops in itscleanup_schema().