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

Make cursor to string migration reversible #1066

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ibrahima
Copy link

I think this fixes #1065.

@@ -12,7 +12,7 @@ def up

def down
change_table(:maintenance_tasks_runs) do |t|
t.change(:cursor, :bigint)
t.change(:cursor, "bigint USING cursor::bigint")
Copy link
Contributor

Choose a reason for hiding this comment

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

This is postgresql specific, right? Which makes it broken for any other database. We should look for a solution that works for all adapters or branch in the worst case

Copy link
Author

Choose a reason for hiding this comment

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

Ohhh, you're right, I forgot about that. I think the CAST function should be cross-platform.

I forgot that the double colons are a PostgreSQLism.
@ibrahima
Copy link
Author

ibrahima commented Aug 20, 2024

I have signed the CLA!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

String cursor migration is not reversible
2 participants