Can't downgrade from beta to stable

AI 生成的摘要

A user, David_Park, reports issues with SSO after attempting to downgrade from Discourse v1.9.0 beta 10 to the stable version 1.8.7, encountering a database error related to the users.email column being read-only. jomaxro clarifies that downgrading versions is not supported. pfaffman suggests using /admin/upgrade to update, but jomaxro corrects that the user actually downgraded by switching to stable in app.yml, which is unsupported. riking explains that newer Discourse versions mark users.email as read-only to prepare for its removal, causing incompatibility with older versions. sam confirms the column is now properly dropped in the latest version, aligning with the new Rails 5.1 feature for marking unused columns.

Created a Discourse server from DO. It was running v1.9.0 beta 10 +87.
When I try to use the stable version: 1.8.7, SSO stopped working and getting error like this.

Failed to create or lookup user: PG::RaiseException: ERROR: Discourse: email in users is readonly : INSERT INTO “users” (“email”, “name”, “username”, “ip_address”, “trust_level”, “username_lower”, …

I just switched back to the beta version and SSO is working for now
Anyone could help me where should I check?

You cannot go down versions, that is not supported.

Thanks for quick reply.
I updated by making “version: stable” in app.yml.
Is that mean I have to wait for stable build with higher version number?

No, you can rebuild or go to /admin/upgrade to upgrade, (but stable doesn’t get updated as often, obviously).

Wait, I think one of us is confused here.

@David_Park You created a new site, which was installed on tests_passed, version 1.9.0.beta10. Next you went into your app.yml file and switched to stable, rebuilt your site, which then caused you to be on version 1.8.7. @codinghorror please correct me if I’m going nuts, but that is going down in versions and we don’t support “backwards” database migrations.

That’s correct. The details of what’s happened is the current versions of Discourse have users.email marked as read-only in preparation for its eventual removal; the older version of Discourse expects to be writing that column.

Which reminds me … I need to drop the column now that we can use the rails 5.1 feature that marks the column unused without a monkey patch.

OK @tgxworld now dropped the email column properly per new pattern.

https://github.com/discourse/discourse/commit/b3237d37f04f8d2daa12783f0a961d92ee938549