プロジェクト

全般

プロフィール

Vote #80110

完了

Add redmine_plugin_migration generator

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Plugin API_20
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
20
version_id:
127
issue_org_id:
31498
author_id:
58128
assigned_to_id:
332
comments:
7
status_id:
5
tracker_id:
3
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

Redmine provides @redmine_plugin_model@ generator. It's similar to @model@ generator by Rails but for Redmine plugin. It's useful to add a new model to Redmine plugin.

But Redmine doesn't provide @redmine_plugin_migration@ generator. It's similar to @migration@ generator by Rails but for Redmine plugin. It's useful to improve existing models in Redmine plugin.

We need to create a migration file for Redmine plugin by hand without @redmine_plugin_migration@.

The attached patch implements @redmine_plugin_migration@ generator. It only has the minimal features:

  • Assign a new migration version.
  • Just create a migration file that only has empty @change@ method.

The @migration@ generator by Rails has more features:

I think that minimum implementation is a good starting point.

This implementation uses the framework for migration provided by Rails: https://github.com/rails/rails/blob/master/railties/lib/rails/generators/migration.rb


journals

--------------------------------------------------------------------------------
>I think that minimum implementation is a good starting point.

+1, nice work!

This is a minute thing but `plugin_pretty_name` declared in line 16 of redmine_plugin_migration_generator.rb is not used so far and probably can be safely removed.
--------------------------------------------------------------------------------
Good catch.
I've updated the patch.
--------------------------------------------------------------------------------
Setting the target version to 4.1.0.
--------------------------------------------------------------------------------
Committed the patch. Thank you.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

Admin Redmine さんが約4年前に更新

  • カテゴリPlugin API_20 にセット
  • 対象バージョン4.1.0_127 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0