Skip to content

Complex Schema Updates Require Database Reset #345

@mrkmadsn

Description

@mrkmadsn

Problem
When working with advanced/complex schemas, bun ronin apply fails to apply new migrations unless the database is completely cleared first.

Steps to Reproduce:
Start with a complex schema containing multiple models with relationships
Add new models to schema/index.ts (in this case: GradeLevel and EducationalContext)
Run bun ronin apply
Migration fails with various constraint/dependency errors
Current Workaround
Delete all data from the RONIN space
Then bun ronin apply works successfully..

Expected Behavior
Migrations should apply successfully without requiring database reset, even with complex schemas.

Impact
Forces data loss during development
Makes iterative schema development difficult
Could be problematic for production deployments

Environment
Blade framework with RONIN database
Complex schema with ~20+ models and relationships
Migration system using .ronin/migrations/

Suggestion
Consider improving the migration system to handle complex schema updates more gracefully, possibly with better dependency resolution or incremental migration strategies.

The schema can be seen here : https://ray.so/14dTuXz

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions