Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Doctrine Schema Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • 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:

    • Multi-tenant SaaS: Dynamically generate tenant-specific schemas from a base YAML template.
    • Legacy Migration: Convert existing SQL schemas to YAML for version control and incremental updates.
    • Plugin/Extension Systems: Allow third-party developers to extend schemas via event subscribers (e.g., adding columns to core tables).
    • Testing: Spin up ephemeral databases with predefined schemas for unit/integration tests.
  • Roadmap Alignment:

    • Phase 1: Replace ad-hoc SQL migrations with YAML-driven schemas for new features.
    • Phase 2: Integrate schema exports into deployment pipelines (e.g., GitHub Actions) to validate schema changes pre-merge.
    • Phase 3: Extend with custom event subscribers for feature flags or A/B testing schema variations.

When to Consider This Package

  • Adopt if:

    • Your project uses Symfony/Laravel with Doctrine DBAL and requires cross-DBMS schema portability.
    • You need schema versioning (e.g., for rollbacks or feature branches) without manual SQL scripts.
    • Your team wants to decouple schema definitions from application logic (e.g., YAML files edited by non-developers).
    • You require extensibility (e.g., adding custom logic via SchemaBuilderEvent subscribers).
    • Your stack includes PHP 8.3+ and Symfony 7.x/Laravel 10.x (or compatible versions).
  • Look Elsewhere if:

    • You’re using raw PDO or Eloquent-only without Doctrine DBAL (this package is DBAL-centric).
    • Your schemas are extremely simple (e.g., <5 tables) and don’t need versioning.
    • You need GUI tools for schema design (consider Adminer, phpMyAdmin, or Laravel Nova).
    • Your project is monolithic with no separation between schema and application code.
    • You require real-time schema changes (e.g., dynamic table creation at runtime); this is for static/predefined schemas.
  • Alternatives to Evaluate:

    • Doctrine Migrations: For SQL-based migrations (less portable across DBMS).
    • Flysystem + Schema Files: Store schemas in cloud storage (e.g., S3) for dynamic loading.
    • Custom Laravel Migrations: If you’re all-in on Laravel and don’t need Symfony integration.

How to Pitch It (Stakeholders)

For Executives:

"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."

For Engineers:

*"This gives us a Symfony-compatible way to manage complex schemas across databases using YAML (think Terraform for DBs). Key benefits:

  • Portability: Write once, deploy to MySQL/PostgreSQL/SQLite.
  • Extensibility: Hook into schema builds with custom logic (e.g., add indexes for a new feature).
  • Safety: Schema changes are version-controlled and testable.
  • Performance: Avoids repeated SQL migrations in CI/CD. Tradeoff: Requires adopting Doctrine DBAL if not already using it. We’d start by migrating one high-churn schema (e.g., users) to YAML and compare deployment stability."*

For Developers:

*"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."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
codifyo/ts-generator-bundle
andydefer/laravel-cluster
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor