NAME

DBIx::Class::Migration::Script::Help::prepare - Create migration files.

SYNOPSIS

dbic-migration prepare \
  --lib=lib \
  --schema_class=MyApp::Schema

DESCRIPTION

Creates a fixtures and migrations directory under "target_dir" (if they don't already exist) and makes deployment files for the current schema. If deployment files exist, will fail unless you "overwrite_migrations".

The migrations directory reflects a directory structure as documented in DBIx::Class::DeploymentHandler.

If this is the first version, we create directories and initial DLL, etc. For versions greater than 1, we will also generate diffs and copy any fixture configs etc (as well as generating a fresh 'all_table.json' fixture config). For safety reasons, we never overwrite any fixture configs (even if overwrite_migrations is true.)

OPTIONS

This command accepts the following options. You may learn more about each option by typing dbic-migration help OPTION. The following is a summary.

includes

Aliases: I,lib,libs,include

Accepts String, Optional.

Adds the listed paths to @INC. Handy during development when you want to use a development schema class.

schema_class (S)

Accepts Str. Required.

This is the schema we use as the basis for creating, managing and running your deployments. This should be the full package namespace defining your subclass of DBIx::Class::Schema. For example MyApp::Schema.

If the "schema_class" cannot be loaded, a hard exception will be thrown.

force_overwrite (O)

Optional. Bool.

Usually if you've already prepared migration files for the current version as specified in your "schema_class" we don't write out files even if you call prepare. If you want to force overwrite previously prepared files (and lose all your customizations) you can do so with this option.

This option won't overwrite previously existing fixture configuration files.

target_dir (D)

Optional. String (Path to directory).

When using a sandbox_class for generating developer level database sandboxes, you may wish to place the sandbox in a directory other than the default (which is under the share directory off the project root).

databases

Aliases: database

Value: Str or Array of Str (default: SQLite). Optional.

By default we create migrations for SQLite. You can use this option to change that default, or to write our migrations for more than one database

You can prepare deployment for any database type that SQL::Translator understands.

dbic-migration prepare --database SQLite --database MySQL --PostgreSQL

Please note if you choose to manually set this value, you won't automatically get the default or inferred type.

sandbox_class

Aliases: T, sb

Accepts: String (default: SqliteSandbox)

The class we use to create a developer level database sandbox.

You can change this to either 'PostgresqlSandbox' or 'MySQLSandbox', which will create a sandbox using either DBIx::Class::Migration::MySQLSandbox or DBIx::Class::Migration::PostgresqlSandbox.

user

Aliases: U

password

Aliases: P

dsn

Connection information to an already created and running instance of a database. If you don't specify this, we will assume you want a developer level sandbox ( See "sandbox").

SEE ALSO

DBIx::Class::Migration, DBIx::Class::Migration::Script, DBIx::Class::Migration::Features, DBIx::Class::Migration::Tutorial

AUTHOR

See DBIx::Class::Migration for author information

COPYRIGHT & LICENSE

See DBIx::Class::Migration for copyright and license information