1.3.15 • Published 4 months ago

migration-collection v1.3.15

Weekly downloads
9
License
-
Repository
github
Last release
4 months ago

Migration collection

Build Status

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

[
    {
        "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
    }
]
1.3.14

4 months ago

1.3.15

4 months ago

1.3.13

4 months ago

1.3.12

5 months ago

1.3.11

5 months ago

1.3.10

5 months ago

1.3.9

5 months ago

1.3.7

5 months ago

1.3.6

5 months ago

1.3.8

5 months ago

1.3.5

2 years ago

1.3.4

2 years ago

1.3.3

2 years ago

1.3.2

2 years ago

1.2.3

2 years ago

1.3.1

2 years ago

1.2.2

2 years ago

1.3.0

2 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago