goose icon indicating copy to clipboard operation
goose copied to clipboard

feature: record up and down sql in db_version table

Open yxlimo opened this issue 2 years ago • 2 comments

In my business, i need to down-to the last version in dir when db version is higher than dir's version.

if i want to do this. i need to get downgrade sql to execute. get it from db is the only way.

yxlimo avatar May 12 '22 04:05 yxlimo

Apologies, not sure I follow. How can the db version be higher than the migrations in the directory?

Are you modifying the database goose migration table?

mfridman avatar May 13 '22 03:05 mfridman

@mfridman thanks for your reply!

Our products are deployed on customers' machines。different customer need different verisons.

The way we run migrations is to execute a job in k8s by helm hook. when customer need to deploy a lower version. we can just use lower version image and downgrade the db version

yxlimo avatar May 13 '22 04:05 yxlimo