Patch #28934

[Rails 5.2] support migration context

Added by Pavel Rosický 3 months ago. Updated about 1 month ago.

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

0%

Category:Rails support
Target version:4.0.0

plugin.rb.patch Magnifier (3.27 KB) Pavel Rosický, 2018-06-02 00:38

add_unittest.patch Magnifier (534 Bytes) Tatsuya Saito, 2018-06-27 00:41

use_migration_context_with_test.patch Magnifier (1.06 KB) Tatsuya Saito, 2018-07-05 16:48

use_migration_context_with_test2.patch Magnifier (3.54 KB) Tatsuya Saito, 2018-07-07 04:23


Related issues

Related to Redmine - Patch #28933: Migrate to Rails 5.2 Closed

History

#1 Updated by Pavel Rosický 3 months ago

#2 Updated by Go MAEDA 3 months ago

#3 Updated by Tatsuya Saito about 1 month ago

I attach a patch to add simple unit test.
I hope to fix this issue :)

#4 Updated by Go MAEDA about 1 month ago

  • Category changed from Performance to Rails support
  • Target version set to 4.0.0

#5 Updated by Toru Takahashi about 1 month ago

+1 this patch is needed to migrate a plugin by redmine:plugins:migrate on rails 5.2.

#6 Updated by Tatsuya Saito about 1 month ago

I think release version like 3.4.x is NOT going to support Rails 5.2, keep 4.x.
So I created a patch which is removed condition of Rails version check for older than trunk.
I attatch it, and it includes add_unittest.patch.

#7 Updated by Pavel Rosický about 1 month ago

@Tatsuya Saito
I agree we can remove the rails version check. Your patch is simple, but wrong. It produces invalid entries in schema_migrations! without a plugin_name suffix.

Btw: my patch also loads schema_migrations only once for all plugins, so there's also a performance impact if you have more plugins installed.

Unfortunatelly I have to duplicate MigrationContext because it calls back the original Migrator class from Rails not the patched one by Redmine. Maybe someone can figure out a better solution.

#8 Updated by Tatsuya Saito about 1 month ago

Pavel Rosický wrote:

@Tatsuya Saito
I agree we can remove the rails version check. Your patch is simple, but wrong. It produces invalid entries in schema_migrations! without a plugin_name suffix.

Thanks comment and sorry broke your patch.
I fix and attach it.

#9 Updated by Pavel Rosický about 1 month ago

It's ok. Thanks for testing

Also available in: Atom PDF