PHPackages                             scherersoftware/cakephp-schema - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. scherersoftware/cakephp-schema

Abandoned → [raul338/cakephp-schema](/?search=raul338%2Fcakephp-schema)ArchivedCakephp-plugin[Database &amp; ORM](/categories/database)

scherersoftware/cakephp-schema
==============================

Schema saving and loading from file for CakePHP 3.0

v1.1(8y ago)111.2k11MITPHP

Since Oct 7Pushed 8y ago4 watchersCompare

[ Source](https://github.com/scherersoftware/cakephp-schema)[ Packagist](https://packagist.org/packages/scherersoftware/cakephp-schema)[ Docs](https://github.com/scherersoftware/cakephp-schema)[ RSS](/packages/scherersoftware-cakephp-schema/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (5)Used By (1)

This repo is not maintained anymore
===================================

[](#this-repo-is-not-maintained-anymore)

For current versions please try the original  or a successor of this one:

Schema plugin for CakePHP 3.0
=============================

[](#schema-plugin-for-cakephp-30)

Save the schema into one file and then restore the database from the schema file. The schema is automatically saved when executing `cake migrations migrate`.

Supported datasources
---------------------

[](#supported-datasources)

- Postgres
- MySQL
- SQL Server
- SQLite not yet

Installation
------------

[](#installation)

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).

The recommended way to install composer packages is:

```
composer require scherersoftware/cakephp-schema

```

Update your `config/bootstrap.php``:

```
Plugin::load('Schema', ['bootstrap' => true]);
```

Usage
-----

[](#usage)

The plugin saves the schema of the `default` connection to the `config/schema.php` file. The structure is similiar to the fixtures fields.

```
cake schema save

```

To load the schema back execute

```
cake schema load

```

All existing tables in the database are dropped before loading. You will be asked

```
Loading the schema from the file Database is not empty. 37 tables will be deleted.
Do you want to continue? (y/n)

```

To disable the question (and answer with yes) run

```
cake schema load --no-interaction

```

### Seed

[](#seed)

The Schema plugin allows you to seed data from the `config/seed.php` file. The `seed.php` file should return array of tables and rows:

```
