Patch #31230

Fix: migration fails in MS SQL-Server

Added by Anders Thomsen 2 months ago. Updated 2 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:


Target version:-


Fixes #24402

Migration fails when building (db:migrate) the database from scratch on SQL-Server. Run db:migrate again an it runs successfully.

It seems to be a cache problem.

Both 3.4 and 4.0 branches should be patched as 4.0 currently fails on SQL-Server (#30285).

Solution was found here:

clear_cache-master.patch Magnifier (588 Bytes) Anders Thomsen, 2019-04-20 08:45

clear_cache-3.4-stable.patch Magnifier (583 Bytes) Anders Thomsen, 2019-04-20 08:45


#1 Updated by Go MAEDA 2 months ago

Anders Thomsen wrote:

Solution was found here:

According to the tread, the problem was fixed in activerecord-sqlserver-adapter 4.2.1. Do we have to fix db/migrate/20160416072926_remove_position_defaults.rb? (sorry, I don't have an environment that runs MS SQL Server)

#2 Updated by Anders Thomsen 2 months ago

Installing Redmine 3.4 pulls activerecord-sqlserver-adapter 4.2.18 (the latest of the 4.2 series). That version does not seem to include the fix so the patch is needed for RM 3.4.

Redmine 4.0 pulls activerecord-sqlserver-adapter 5.2 where it seems to be fixed. Can't test with 4.0 though because of the other bug so lets wait until that gets resolved to see if it is necessary for 4.0 as well.

Also available in: Atom PDF