Giter Site home page Giter Site logo

popara / hasql-migration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tvh/hasql-migration

0.0 1.0 0.0 31 KB

A port of postgresql-simple-migration for use with hasql

Home Page: http://hackage.haskell.org/package/hasql-migration

License: Other

Haskell 100.00%

hasql-migration's Introduction

PostgreSQL Migrations for Haskell

Build Status

Welcome to hasql-migrations, a tool for helping you with PostgreSQL schema migrations. This is a port of postgresql-simple-migration for use with hasql.

Why?

Database migrations should not be hard. They should be under version control and documented in both your production systems and in your project files.

What?

This library executes SQL/Haskell migration scripts and keeps track of their meta information.

Scripts are be executed exactly once and any changes to scripts will cause a run-time error notifying you of a corrupted database.

The meta information consists of:

  • an MD5 checksum of the executed script to make sure already existing scripts cannot be modified in your production system.
  • a time-stamp of the date of execution so you can easily track when a change happened.

This library also supports migration validation so you can ensure (some) correctness before your application logic kicks in.

How?

TODO

Compilation and Tests

The program is built with the cabal build system. The following command builds the library, the standalone binary and the test package.

cabal configure --enable-tests && cabal build -j

To execute the tests, you need a running PostgreSQL server with an empty database called test. Tests are executed through cabal as follows:

cabal configure --enable-tests && cabal test

To build the project in a cabal sandbox, use the following code:

cabal sandbox init
cabal install -j --only-dependencies --enable-tests --disable-documentation
cabal configure --enable-tests
cabal test

To remove the generated cabal sandbox, use:

cabal sandbox delete

To Do

  • Collect executed scripts and check if already executed scripts have been deleted.

hasql-migration's People

Contributors

expipiplus1 avatar sumo avatar tvh avatar

Watchers

 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.