micheljonkman/declarative-schema

1.4.0 2024-03-25 14:34 UTC

This package is auto-updated.

Last update: 2024-04-25 14:48:44 UTC


README

Uses doctrine/dbal to manage a declarative schema approach.

Usage

This package has only been tested on MySQL but might work for other databases too.

Create a schema.config.php file in the directory where your vendor folder is. Go to examples to find an example of this file.

To create a migration use:

php vendor/bin/schema make:schema table_name

The DBAL docs provide documentation on how to create new columns and indexes. Some Laravel like methods have also been added for ease of use.

For an example schema file go to examples.

Then you can call the following command to run the changes on the database.

php vendor/bin/schema migrate:schema