Skip to content
This repository was archived by the owner on Jun 28, 2018. It is now read-only.
This repository was archived by the owner on Jun 28, 2018. It is now read-only.

Support go migrations #344

@denismakogon

Description

@denismakogon

SQL migrations is a good thing, but likely useless in many cases. Migrate must support go migrations, i.e a function that accepts an instance of the database or a transaction object (in case of SQL datastores).
Something along the lines of this to up the version:

func up(tx *sql.Tx) error {
         _, err := tx.Exec("ALTER TABLE calls ADD stats text;")
	return err
}

down also looks the same:

func down(tx *sql.Tx) error {
	_, err := tx.Exec("ALTER TABLE calls DROP COLUMN stats;")
	return err
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions