Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zetxx/migration-collection
migration tools
https://github.com/zetxx/migration-collection
fs javascript migrations mssql nodejs
Last synced: 3 months ago
JSON representation
migration tools
- Host: GitHub
- URL: https://github.com/zetxx/migration-collection
- Owner: zetxx
- Created: 2020-11-26T14:44:08.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2024-07-24T06:06:27.000Z (5 months ago)
- Last Synced: 2024-08-24T18:15:56.080Z (4 months ago)
- Topics: fs, javascript, migrations, mssql, nodejs
- Language: JavaScript
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Migration collection
[![Build Status](https://travis-ci.com/zetxx/migration-collection.svg?branch=master)](https://app.travis-ci.com/github/zetxx/migration-collection)
Simple implementation of migration collection, ideas written down.
aims to be easy for use, easy to be extended.currently only filesystem, mssql, mariadb, postgres migration is implemented
*NOTE: every component can be redefined and added instead of
default one*- `feeder` - feeds with data collection, reads files from fs, and filters them
based on extension
- `sorter` - sorts files based on it integer key
eg. if file name is `121_abc.sql`, integer keys is `121`
- `importer` - imports migration file
- `parser` - parses imported file
- `ledger` - do the migration, acquire locks, check if migration is executed,
execute it, and write it down
- `end` executes at the end, no mather if error was raised
or migration succeeded## Examples - in example dir
all of them should return following structure
```js
[
{
"baseName": "1_bca.sql",
"path": "tests/unit/runtime/migration",
"content": [
"--------------UP",
"SELECT 'up'",
"--------------DOWN",
"SELECT 'down'"
],
"parsed": {
"up": "SELECT 'up'",
"down": "SELECT 'down'"
},
"migrated": false
},
{
"baseName": "2_abc.sql",
"path": "tests/unit/runtime/migration",
"content": [
"--------------UP",
"SELECT 'up'",
"--------------DOWN",
"SELECT 'down'"
],
"parsed": {
"up": "SELECT 'up'",
"down": "SELECT 'down'"
},
"migrated": true
},
{
"baseName": "5_abc.sql",
"path": "tests/unit/runtime/migration",
"content": [
"--------------UP",
"SELECT 'up'",
"--------------DOWN",
"SELECT 'down'"
],
"parsed": {
"up": "SELECT 'up'",
"down": "SELECT 'down'"
},
"migrated": true
},
{
"baseName": "123_abc.sql",
"path": "tests/unit/runtime/migration",
"content": [
"--------------UP",
"SELECT 'up'",
"--------------DOWN",
"SELECT 'down'"
],
"parsed": {
"up": "SELECT 'up'",
"down": "SELECT 'down'"
},
"migrated": true
}
]
```