Giter VIP home page Giter VIP logo

dbvc's Introduction

DBVC

The dbvc commandline tool allows you to manage your database schema updates in your version control (git) repository.

Configuration

DBVC looks for the dbvc.json configuration file.

{
  "db": {
    "driver": "mysql",
    "host": "localhost",
    "username": "root",
    "password": "open",
    "dbname": "foobar"
  },
  "datadir": "dev",
  "vcs": "none"
}

If datadir is omitted, it defaults to "dev". If vcs is omitted, the vcs is automatically determined.

Supported database interfaces

  • mysql

You may issue a feature request to support other DBMSs.

Supported version control systems

  • git
  • none

You may issue a feature request to support other VCSs.

When using git, the correct order of the updates is automatically found by examining the git log.

When selecting vcs 'none', updates are run in natural order. It's up to you to prefix the update files with (for instance) a date, to make sure that run in the correct order

Usage

Show a list of commands

dbvc help

Show help on a specific command

dbvc help init

Initialise DBVC for an existing database.

dbvc init

Create a database dump. This is used to create the DB on a new environment.

mysqldump foobar > dev/schema.php

Create the DB using the schema.

dbvc create

Add an update file. These are used to update the DB on other environments.

echo 'ALTER TABLE `foo` ADD COLUMN `status` BOOL DEFAULT 1;' > dev/updates/add-status-to-foo.sql

Mark an update as already run.

dbvc mark add-status-to-foo

Show a list of updates that need to be run.

dbvc status

Show all updates with their status.

dbvc status --all

Update the database.

dbvc update

dbvc's People

Contributors

jasny avatar

Watchers

James Cloos 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.