GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  GITDDL::MIGRATOR (3)

.ds Aq ’

NAME

GitDDL::Migrator - database migration utility for git managed SQL extended GitDDL

CONTENTS

SYNOPSIS



    use GitDDL::Migrator;
    my $gd = GitDDL::Migrator->new(
        work_tree => /path/to/project, # git working directory
        ddl_file  => sql/schema_ddl.sql,
        dsn       => [dbi:mysql:my_project, root, ],
    );



DESCRIPTION

GitDDL::Migrator is database migration utility extended GitDDL.

GitDDL is very cool module. It’s very simple and developer friendly. I use it in development, but features of it are not enough in operation phase.

Features needed at operation phases are: e.g.
save migration history
rollback to previous version
specify version
specify SQL (sometimes SQL::Translator’s output is wrong)
check differences from versioned SQL and real database
Then for solving them, I wrote GitDDL::Migrator.

METHODS

CWGitDDL::Migrator->new(%options)

Create GitDDL::Migrator object. Available options are:
work_tree => ’Str’ (Required) Git working tree path includes target DDL file.
ddl_file => ’Str’ (Required) DDL file (.sql file) path in repository.

If DDL file located at /repos/project/sql/schema.sql and work_tree root is /repos/project, then this option should be sql/schema.sql

dsn => ’ArrayRef’ (Required) DSN parameter that pass to DBI module.
version_table => ’Str’ (optional) database table name that contains its git commit version. (default: git_ddl_version)
ignore_tables => ’ArrayRef’ (optional) tables for ignoring when calling check_ddl_mismatch(). (default: empty)

CW$gd->migrate(%opt)

migrate database

CW$gd->real_diff

display differences from versioned DDL and real database setting.

CW$gd->diff_to_real_database

alias of real_diff

CW$gd->diff_from_real_database

display differences from real database setting and versioned DDL.

CW$gd->check_ddl_mismatch

check differences from versioned DDL and real database setting.

CW$gd->get_rollback_version

get previous database version.

CW$gd->rollback_diff

display differences SQL from current version and previous version.

CW$gd->create_version_table

Only create version table, don’t deploy any other SQLs. It is useful to apply GitDDL::Migrator to existing databases.

LICENSE

Copyright (C) Masayuki Matsuki.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Masayuki Matsuki <y.songmu@gmail.com>
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 GITDDL::MIGRATOR (3) 2016-04-03

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.