Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Add error when mysql is trying to be loaded

Oliver Güntherd38c1e4581ca
diff --git a/config/initializers/01-mysql-error.rb b/config/initializers/01-mysql-error.rb
new file mode 100644
index 00000000000..5989461439b
--- /dev/null
+++ b/config/initializers/01-mysql-error.rb
@@ -0,0 +1,20 @@
+db_adapter = ActiveRecord::Base.configurations[Rails.env]['adapter']
+if db_adapter.start_with? 'mysql'
+ warn <<~ERROR
+ ======= INCOMPATIBLE DATABASE DETECTED =======
+ Your database is set up for use with a MySQL or MySQL-compatible variant.
+ This installation of OpenProject 10.0. no longer supports these variants.
+
+ The following guides provide extensive documentation for migrating
+ your installation to a PostgreSQL database:
+
+ https://www.openproject.org/migration-guides/
+
+ This process is mostly automated so you can continue using your
+ OpenProject installation within a few minutes!
+
+ ==============================================
+ ERROR
+
+ Kernel.exit 1
+end