Giter VIP home page Giter VIP logo

db-deployment's Introduction

This page describe the update database script from the deployment process

In the deployment folder a file called "changesets" exists. In this file a list of directories exists. All these directories exists in the changesets folder.

For each directory in this file a number of sql files exists. Whenever the update script runs it will run all sql scripts in order (see naming below) in each folder listed in the changesets.txt file.

When a folder has been run once, it will not be run again in any future runs of the script.

This means that when a changeset (folder) has been run, it will do no good adding a sql file to that folder, since it will not be run again.

Naming of sql files

The files in a changeset folder are run in alphanumeric order, meaning that files beginning with 1,2,3, etc are run first. Then files beginning with a,b,c .. will be run

Example

So this folder structure could be one way of doing it

|-changesets
|  |-AddColumnToTable
|  |  \--1 AddColumnToTable.sql
|  \-CreateTable
|     |-1 CreateTable.sql
|     \-2 AddIndices.sql
\-changesets.txt

The changesets.txt would simply look like this:
CreateTable
AddColumnToTable

Internal Stuff

The script keeps track of which files have been run in a table called db_changes. If this table does not exist when the script is run, the script will create it.

In the table, only changesets ie. directory names are saved.

db-deployment's People

Watchers

 avatar  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.