0

With Rails, adding columns is easy as this link:

Ruby on Rails: adding columns to existing database

With Redmine Plugin, adding columns for plugin's table seems OK as this link: http://www.redmine.org/boards/2/topics/39008

But in my Redmine Plugin, I want to add columns to Redmine's built-in table (for example, I want to add a column named 'my_own_syntax' to "queries" table). Can I do this?

Community
  • 1
  • 1
vietstone
  • 8,784
  • 16
  • 52
  • 79

2 Answers2

2

it is just a new migration

class AddMyOwnSyntaxToQueries < ActiveRecord::Migration
  def change
    add_column :queries, :my_own_syntax, :text
  end
end
gotva
  • 5,919
  • 2
  • 25
  • 35
2

To add migrations to your plugin create them under

your_newplugin_folder
|- db
   |- migrate
      |-01_fancy_migration.rb

Use numeration for migration files(in filenames but not in class names)

execute em with: rake redmine:plugins:migrate

Noma4i
  • 751
  • 7
  • 19