Giter Site home page Giter Site logo

puppet-database_schema's Introduction

database_schema

This module manages the process of applying database schema migration scripts as part of a puppet manifest. The actual migration process is dispatched to a database migration tool.

The tools currently supported are:

This module can also manage the installation of supported tools.

Getting Started

If you are new to database migration tools and want to get started quickly, start with Flyway. Flyway uses straight sql scripts, where the only requirement is how th files are named (ie "V1__SomeScript.sql", "V2__AnotherScript.sql"). Use this module to install flyway, and you should be migrating databases in no time at all.

The example below shows how this can be done.

Examples

The following example ensures flyway is installed and that migrations have been applied to a MySql database.

include ::database_schema::flyway

database_schema::flyway_migration { 'Migrate TestDB':
  db_username   => root,
  db_password   => password,
  jdbc_url      => 'jdbc:mysql://localhost/testdb',
  schema_source => '/vagrant/tests/data/stage1'
}

The following example will only migrate up to version 1.2

include ::database_schema::flyway

database_schema::flyway_migration { 'Migrate TestDB':
  db_username   => root,
  db_password   => password,
  jdbc_url      => 'jdbc:mysql://localhost/testdb',
  schema_source => '/vagrant/tests/data/stage1',
  ensure        => '1.2'
}

Limitations

  • flyway_migration currently only supports SQL based migrations.
  • liquibase installs liquibase but not any jdbc drivers. These need to be installed to the lib folder of liquibase for the database in use.

puppet-database_schema's People

Contributors

cpitman avatar

Watchers

Bryan Heisler avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.