Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support go migrations #18

Closed
denismakogon opened this issue Apr 17, 2018 · 1 comment
Closed

Support go migrations #18

denismakogon opened this issue Apr 17, 2018 · 1 comment

Comments

@denismakogon
Copy link

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
}

original issue: mattes/migrate#344

@dhui
Copy link
Member

dhui commented Apr 17, 2018

Duplicate of #15
Use that issue for discussion

@dhui dhui closed this as completed Apr 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants