ibexa/doctrine-schema
Symfony bundle that abstracts cross-DBMS schema import/export. Defines a custom YAML schema format, imports YAML into Doctrine DBAL Schema, exports Schema back to YAML, and provides an event-driven SchemaBuilder extension point via subscribers.
Database Schema Management as a Service: Adopt this package to centralize schema definitions (import/export) for multi-database Laravel/Symfony projects, reducing manual SQL migrations and improving cross-team consistency. Ideal for teams managing complex schemas across PostgreSQL, MySQL, or SQLite.
Infrastructure as Code (IaC) for Databases: Enable declarative schema management via YAML, aligning with IaC principles. Useful for CI/CD pipelines where schema updates must be version-controlled and reproducible.
Build vs. Buy Decision: Buy if your team lacks in-house expertise for cross-DBMS schema abstraction or needs event-driven extensibility (e.g., pre/post-schema hooks). Build only if you require custom schema validation or non-YAML formats (e.g., JSON).
Use Cases:
Roadmap Alignment:
Adopt if:
SchemaBuilderEvent subscribers).Look Elsewhere if:
Alternatives to Evaluate:
"This package lets us treat database schemas like infrastructure code—version-controlled, portable, and extensible. By moving from manual SQL scripts to YAML definitions, we’ll reduce deployment errors, accelerate onboarding for new databases (e.g., PostgreSQL for analytics), and enable third-party extensions without touching core code. The event-driven architecture also future-proofs us for dynamic schema needs, like multi-tenancy or feature-flags. Upfront cost: minimal (integration effort); long-term ROI: fewer outages and faster schema iterations."
*"This gives us a Symfony-compatible way to manage complex schemas across databases using YAML (think Terraform for DBs). Key benefits:
users) to YAML and compare deployment stability."**"If you’re tired of writing SQL migrations or fighting DBMS quirks, this lets you define schemas in YAML and let the package handle the rest. Example:
# config/schema.yml
tables:
users:
columns:
id: { type: integer, primary: true }
email: { type: string, length: 255, unique: true }
Then in PHP:
$schema = $schemaBuilder->buildSchema();
$connection->getSchemaManager()->createSchema($schema);
Pros: No more php artisan migrate for schema changes. Cons: Steeper learning curve if you’ve never used Doctrine DBAL. Let’s prototype it for the products table first."*
How can I help you explore Laravel packages today?