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

fix(clickhouse): Fix list query to order by timestamp #644

Closed
wants to merge 1 commit into from

Conversation

mfridman
Copy link
Collaborator

No description provided.

@@ -34,6 +34,6 @@ func (c *Clickhouse) GetMigrationByVersion(tableName string) string {
}

func (c *Clickhouse) ListMigrations(tableName string) string {
q := `SELECT version_id, is_applied FROM %s ORDER BY version_id DESC`
q := `SELECT version_id, is_applied FROM %s ORDER BY tstamp DESC`
Copy link
Collaborator Author

@mfridman mfridman Nov 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taken from https://github.com/pressly/goose/pull/520/files#diff-118cd56230b5f8c82d68543435dafd356994d4c90b8986fdcf8750d663356cb6R62

Discussion https://github.com/pressly/goose/pull/520/files#r1196945088

Need to think about this one, since the default precision is 1 second?

The more I think about it, maybe the only correct ordering for down (out-of-order) migration is by version.

https://twitter.com/brandur/status/1661654624300851200

Voted 4,3,2,1 because I feel like even if out of order was applied on the way up, it'd be easy to forget that later, so it should go back to being predictable based on version, but not sure.

This brings us back to this discussions in #402 and #523

@mfridman mfridman closed this Dec 15, 2023
@mfridman mfridman deleted the fix-clickhouse branch December 15, 2023 04:14
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

Successfully merging this pull request may close these issues.

1 participant