-
-
Notifications
You must be signed in to change notification settings - Fork 173
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
Wakapi init on CockroachDB #442
Comments
Thanks for bringing this up. I tried to fix this, but when setting
The error is thrown for the following query, that is part of GORM's auto schema migrations. ALTER TABLE "users" ALTER COLUMN "share_data_max_days" TYPE bigint USING "share_data_max_days"::bigint Tbh., I have no clue what "computed" columns are and what that error is about. Would love to get some help on this! |
I questioned why these seemingly useless queries were even happening in the first place and pushed a fix to prevent them. Initial setup works fine with Cockroach now. However, when restarting Wakapi, another issue occurs:
For query: ALTER TABLE "heartbeats" ALTER COLUMN "time" TYPE timestamp(3) USING "time"::timestamp(3) I don't know why GORM thinks that migration is relevant either, but I also don't know how to prevent it. I'd assume that it's just due to a lack in compatibility of GORM's Postgres driver with Cockroach. A temporary workaround is to set I'll see if I can debug this further and potentially file an issue with GORM. |
My knowledge of Go, SQL, and CockroachDB are pretty limited, so I wasn't able to figure a solution. I guess I will wait for it to be natively supproted by CockroachDB in 2023. I think I will go back to the good old PostgreSQl and abandon easy clustering because I have to much issue with Cockroach and other selfhosted services (nextcloud and coder). CockroachDB will maybe be more Postgres compatible in the future. You can keep the issue open in hope for future support. |
That sounds like a plan to me. I think there is part of the problem on both ends - on the hand, Cockroach is still not 100 % Postgres-compatible, but on the other hand, GORM seems to be doing weird things, too. At some point, I want to dig a bit deeper into why GORM issues all these unneeded migration queries on startup. Thanks for these interesting insights, though! I also considered Cockroach an option for Wakapi.dev, because I think the current single-node MySQL setup will reach its limits not too far in the future as data volume keeps growing. But given your findings, I'll probably rather go for a "traditional" MySQL- or Postgres cluster. |
I have made a post on Reddit about CockroachDB and it's current use with selfhosted services. Someone says that Yugabyte is more compatible than CockroachDB. I might test it later with his free tier and maybe, it will work ¯\(ツ)/¯ I don't know. |
Wakapi 2.8.0 seems to be working with Cockroach 23.1.5 🙌. At least migrations and integration tests run successfully. |
Describe the bug
Wakapi won't initialize at first boot : DB migration won't go throught :
System information
Please provide information on:
Related Docs :
https://www.cockroachlabs.com/docs/v22.2/alter-column#alter-column-data-types
The text was updated successfully, but these errors were encountered: