dravencms/database

DravenCMS Database

Maintainers

Package info

github.com/dravencms/database

Type:dravencms-package

pkg:composer/dravencms/database

Transparency log

Statistics

Installs: 213

Dependents: 3

Suggesters: 0

Stars: 0

Open Issues: 0

0.2.3 2026-08-25 00:33 UTC

This package is auto-updated.

Last update: 2026-08-25 00:35:37 UTC


README

Doctrine ORM and Nettrine integration for DravenCMS. It configures the database connection, entity manager, migrations, fixtures, common entity traits, and package fixture discovery.

Features

  • Nettrine DBAL and Doctrine ORM configuration.
  • Project migrations stored under migrations/ and grouped by year.
  • Fixture loading from installed DravenCMS packages.
  • DravenCMS entity manager and default repository classes.
  • Reusable identifier, UUID, timestamp, and soft-delete traits.
  • Atlantic18 behavior extension integration.

Installation

composer require dravencms/database

Define the connection parameters used by dravencms.config.neon:

parameters:
    database:
        driver: pdo_mysql
        host: 127.0.0.1
        port: 3306
        user: app
        password: secret
        dbname: app

Store production credentials in local or environment-specific configuration.

Entity Mapping

Feature packages add mappings to nettrine.orm.managers.default.mapping. New entities should use Doctrine PHP attributes. Common DravenCMS entities can compose these traits:

use Dravencms\Database\Attributes\Identifier;
use Dravencms\Database\Attributes\TimestampableEntity;

class Article
{
    use Identifier;
    use TimestampableEntity;
}

Migrations and Fixtures

Use the application's Nettrine/Doctrine console commands to generate and execute migrations. To purge the database and load all fixtures registered by DravenCMS package extensions, run:

php bin/console database:default-data:load

The default-data command is destructive because Doctrine's fixture executor purges existing mapped data before loading fixtures. Run it only against a database that may be reset.

License

This package is licensed under the LGPL-3.0 license.