Class | OpenWFE::Extras::WorkitemTables |
In: |
lib/openwfe/extras/participants/activeparticipants.rb
|
Parent: | ActiveRecord::Migration |
The migration for ActiveParticipant and associated classes.
There are two tables ‘workitems’ and ‘fields’. As its name implies, the latter table stores the fields (also called attributes in OpenWFE speak) of the workitems.
See Workitem and Field for more details.
For centralization purposes, the migration and the model are located in the same source file. It should be quite easy for the Rails hackers among you to sort that out for a Rails based usage.
# File lib/openwfe/extras/participants/activeparticipants.rb, line 108 108: def self.down 109: 110: drop_table :workitems 111: drop_table :fields 112: end
# File lib/openwfe/extras/participants/activeparticipants.rb, line 72 72: def self.up 73: 74: create_table :workitems do |t| 75: t.column :fei, :string 76: t.column :wfid, :string 77: t.column :wf_name, :string 78: t.column :wf_revision, :string 79: t.column :participant_name, :string 80: t.column :store_name, :string 81: t.column :dispatch_time, :timestamp 82: t.column :last_modified, :timestamp 83: 84: t.column :yattributes, :text 85: # when using compact_workitems, attributes are stored here 86: 87: end 88: add_index :workitems, :fei, :unique => true 89: add_index :workitems, :wfid 90: add_index :workitems, :wf_name 91: add_index :workitems, :wf_revision 92: add_index :workitems, :participant_name 93: add_index :workitems, :store_name 94: 95: create_table :fields do |t| 96: t.column :fkey, :string, :null => false 97: t.column :vclass, :string, :null => false 98: t.column :svalue, :string 99: t.column :yvalue, :text 100: t.column :workitem_id, :integer, :null => false 101: end 102: add_index :fields, [ :workitem_id, :fkey ], :unique => true 103: add_index :fields, :fkey 104: add_index :fields, :vclass 105: add_index :fields, :svalue 106: end