Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/3noch/drifter-project-m36
Drifter migration backend for Project:M36
https://github.com/3noch/drifter-project-m36
database drifter haskell migration project-m36
Last synced: 20 days ago
JSON representation
Drifter migration backend for Project:M36
- Host: GitHub
- URL: https://github.com/3noch/drifter-project-m36
- Owner: 3noch
- License: bsd-3-clause
- Created: 2017-09-19T03:35:33.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-10-09T15:05:08.000Z (over 7 years ago)
- Last Synced: 2024-11-07T01:45:20.561Z (2 months ago)
- Topics: database, drifter, haskell, migration, project-m36
- Language: Haskell
- Homepage:
- Size: 6.84 KB
- Stars: 4
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# drifter-project-m36
[![Haskell Programming Language](https://img.shields.io/badge/language-Haskell-blue.svg)](http://www.haskell.org)
[![BSD3 License](http://img.shields.io/badge/license-BSD3-brightgreen.svg)](https://tldrlegal.com/license/bsd-3-clause-license-%28revised%29)
[![Hackage](https://img.shields.io/hackage/v/drifter-project-m36.svg)](http://hackage.haskell.org/package/drifter-project-m36)
[![Build status](https://travis-ci.org/3noch/drifter-project-m36.svg?branch=master)](https://travis-ci.org/3noch/drifter-project-m36)
[![Hackage-Deps](https://img.shields.io/hackage-deps/v/drifter-project-m36.svg)](http://packdeps.haskellers.com/feed?needle=drifter-project-m36)Drifter migration backend for the amazing Project: M36 database.
This package is maintained by [Grafted-In](https://www.graftedin.io/).
## Example
```haskell
import qualified Data.Map.Strict as Map
import Data.Text (Text)
import Drifter.ProjectM36
import Drifter.ProjectM36.RelSchema
import ProjectM36.Atomable (toAtomType)
import ProjectM36.Client.Simplemain :: IO ()
main = do
dbConn <- ... -- use ProjectM36.Client.Simple
runMigrations dbConn schemaChangesschemaChanges :: [Change PM36Migration]
schemaChanges = [
Change{
changeName = ChangeName "make-relvar-purchases",
changeDescription = Nothing,
changeDependencies = [],
changeMethod = MigrationStep (
defineRelSchema $ RelSchema "purchases" $ Map.fromList [
("purchaseUuid", (TextAtomType, Unique)),
("purchasePersonName", (TextAtomType, NonUnique)),
("purchasePersonEmail", (TextAtomType, NonUnique)),
("purchaseStates", (toAtomType $ undefined @[Text], NonUnique)),
("purchasePriceCents", (IntAtomType, NonUnique)),
("purchaseDownloads", (IntAtomType, NonUnique)),
("purchaseTimestamp", (DateTimeAtomType, NonUnique))
]
)
}
]
```