退役SEのつれづれ日記

定年退役SEが、つれづれなる想いをしたためています。
(旧名:『システムノヲニワソト』)

[redmine][plugin]TaggingPluginを導入してみました

2016-05-04 | サーバ設定(redmine,zabbix
redmineのチケットに対して、タグを付与するためのプラグインを導入してみる。

チケットの内容にタグ付けして、プロジェクト間/プロジェクト内での横串での検索・括りを可能としたい。

そこで、このプラグインの出番です。

いろいろなサイトで紹介されているので、興味はありました。

(参考)
daybreaksnow's diary:[Redmine]タグ付けを可能にするプラグインを入れる
 http://daybreaksnow.hatenablog.jp/entry/2014/04/08/120039
Qiita:僕がredmineに入れてる便利なプラグインとデザインの格好良いテーマ
 http://qiita.com/y_hokkey/items/7c02a3af319b353136d5

以下のサイトから、コード入手して実装確認です。

(参考)
Undev/redmine_tagging :pluginのオリジナルページ
https://github.com/Undev/redmine_tagging

(1)サイト記載導入手順
rm Gemfile.lock
bundle install
bundle exec rake acts_as_taggable_on_engine:install:migrations RAILS_ENV=production
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake db:migrate_plugins RAILS_ENV=production


(2)実施した手順と結果
[redmine@hogehoge htdocs]# bundle install
・・・
Fetching git://github.com/Undev/rails_sql_views.git
Fetching gem metadata from https://rubygems.org/...........
Fetching version metadata from https://rubygems.org/...
Fetching dependency metadata from https://rubygems.org/..
Resolving dependencies......................................................................................................................
Installing rake 11.1.2
・・・
Bundle complete! 37 Gemfile dependencies, 62 gems now installed.
Gems in the groups development, test and sqlite were not installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.
Post-install message from acts-as-taggable-on:
When upgrading

Re-run the migrations generator

rake acts_as_taggable_on_engine:install:migrations

It will create any new migrations and skip existing ones
[redmine@hogehoge htdocs]# bundle exec rake acts_as_taggable_on_engine:install:migrations RAILS_ENV=production
Copied migration 20160504060939_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb from acts_as_taggable_on_engine
Copied migration 20160504060940_add_missing_unique_indices.acts_as_taggable_on_engine.rb from acts_as_taggable_on_engine
Copied migration 20160504060941_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb from acts_as_taggable_on_engine
Copied migration 20160504060942_add_missing_taggable_index.acts_as_taggable_on_engine.rb from acts_as_taggable_on_engine
[redmine@hogehoge htdocs]# bundle exec rake --trace db:migrate RAILS_ENV=production
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20160504060939 ActsAsTaggableOnMigration: migrating ========================
-- create_table(:tags)
-> 0.1150s
-- create_table(:taggings)
-> 0.1054s
-- add_index(:taggings, :tag_id)
-> 0.0971s
-- add_index(:taggings, [:taggable_id, :taggable_type, :context])
-> 0.1031s
== 20160504060939 ActsAsTaggableOnMigration: migrated (0.4218s) ===============

== 20160504060940 AddMissingUniqueIndices: migrating ==========================
-- add_index(:tags, :name, {:unique=>true})
-> 0.1062s
-- remove_index(:taggings, :tag_id)
-> 0.0392s
-- remove_index(:taggings, [:taggable_id, :taggable_type, :context])
-> 0.0272s
-- add_index(:taggings, [:tag_id, :taggable_id, :taggable_type, :context, :tagger_id, :tagger_type], {:unique=>true, :name=>"taggings_idx"})
-> 0.0475s
== 20160504060940 AddMissingUniqueIndices: migrated (0.2217s) =================

== 20160504060941 AddTaggingsCounterCacheToTags: migrating ====================
-- add_column(:tags, :taggings_count, :integer, {:default=>0})
-> 0.1045s
== 20160504060941 AddTaggingsCounterCacheToTags: migrated (0.1387s) ===========

== 20160504060942 AddMissingTaggableIndex: migrating ==========================
-- add_index(:taggings, [:taggable_id, :taggable_type, :context])
-> 0.0608s
== 20160504060942 AddMissingTaggableIndex: migrated (0.0612s) =================

** Invoke db:_dump (first_time)
** Execute db:_dump
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:schema:dump
[redmine@hogehoge htdocs]# bundle exec rake --trace db:migrate_plugins RAILS_ENV=production
** Invoke db:migrate_plugins (first_time)
** Invoke redmine:plugins:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:plugins:migrate
・・・
Migrating redmine_tagging (Redmine Tagging Plugin)...
== 11 CreateViews: migrating ==================================================
-- execute(" CREATE VIEW issue_tags AS\n SELECT\n taggings.id AS id,\n tags.name AS tag,\n taggings.taggable_id AS issue_id\n FROM\n taggings\n JOIN tags ON taggings.tag_id = tags.id\n WHERE\n taggable_type = 'Issue'\n")
-> 0.0922s
-- execute(" CREATE VIEW wiki_page_tags AS\n SELECT\n taggings.id,\n tags.name AS tag,\n taggings.taggable_id AS wiki_page_id\n FROM\n taggings\n JOIN tags ON taggings.tag_id = tags.id\n WHERE\n taggable_type = 'WikiPage'\n")
-> 0.0105s
== 11 CreateViews: migrated (0.1036s) =========================================

== 12 ScrubBody: migrating ====================================================
== 12 ScrubBody: migrated (0.0322s) ===========================================

== 13 RecreateViews: migrating ================================================
-- execute("DROP VIEW issue_tags")
-> 0.0012s
-- execute("DROP VIEW wiki_page_tags")
-> 0.0008s
-- execute(" CREATE VIEW issue_tags AS\n SELECT\n taggings.id AS id,\n tags.name AS tag,\n taggings.taggable_id AS issue_id\n FROM\n taggings\n JOIN tags ON taggings.tag_id = tags.id\n WHERE\n taggable_type = 'Issue'\n")
-> 0.0097s
-- execute(" CREATE VIEW wiki_page_tags AS\n SELECT\n taggings.id,\n tags.name AS tag,\n taggings.taggable_id AS wiki_page_id\n FROM\n taggings\n JOIN tags ON taggings.tag_id = tags.id\n WHERE\n taggable_type = 'WikiPage'\n")
-> 0.0170s
== 13 RecreateViews: migrated (0.0297s) =======================================

== 14 FixTaggingContexts: migrating ===========================================
== 14 FixTaggingContexts: migrated (0.0231s) ==================================

== 16 FixBrokenIssueAndWikiContexts: migrating ================================
== 16 FixBrokenIssueAndWikiContexts: migrated (0.0043s) =======================

== 18 FixTagsWithBackslash: migrating =========================================
== 18 FixTagsWithBackslash: migrated (0.0051s) ================================

・・・
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:schema:dump
** Execute db:migrate_plugins

Note: The rake task db:migrate_plugins has been deprecated, please use the replacement version redmine:plugins:migrate

[redmine@hogehoge htdocs]# bundle exec rake --trace redmine:plugins:migrate RAILS_ENV=production
** Invoke redmine:plugins:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute redmine:plugins:migrate
・・・
Migrating redmine_tagging (Redmine Tagging Plugin)...
・・・
** Invoke db:schema:dump (first_time)
** Invoke environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:schema:dump


これで、なんとかタグ入力ができるようになった。



(追記)2016-05-04 23:16:04
tagging_pluginの設定の2つの機能のチェックを設定すると、チケットの登録画面に表示されない事象があり、
まずは、新規登録時に表示されるように設定しないほうが良さそうです。
コメント    この記事についてブログを書く
  • Twitterでシェアする
  • Facebookでシェアする
  • はてなブックマークに追加する
  • LINEでシェアする
« [redmine][plugin]checklist... | トップ | [bitnami][redmine]3.2.2がリ... »

コメントを投稿

ブログ作成者から承認されるまでコメントは反映されません。