- •Утвержден
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •Исходный код шаблонов видов
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
- •02070743.00569-01 12 01
402070743.00569-01 12 01
class CreateTickettexts < ActiveRecord::Migration
def self.up
create_table :tickettexts do |t|
t.column :ticket_id, :integer
t.column :post_type, :string
t.column :user_id, :integer
t.column :text_content, :text
t.column :created_at, :datetime#this will get populated automatically
end
def self.down
drop_table :tickettexts
end
end
#-----------------------------------------------------------------------------------005_create_attachments.rb
class CreateAttachments < ActiveRecord::Migration
def self.up
create_table :attachments do |t|
t.column :ticket_text_id, :integer
t.column :mime_type, :string
t.column :data, :binary
t.column :created_at, :datetime
end
end
def self.down
drop_table :attachments
end
end
#----------------------------------------------------------------------------------------006_create_settings.rb
class CreateSettings < ActiveRecord::Migration
def self.up
create_table :settings do |t|
t.column :name, :string
t.column :value, :string
end
end
def self.down
drop_table :settings
end
end
#---------------------------------------------------------------------------------007_create_ticketstatuses.rb
class CreateTicketstatuses < ActiveRecord::Migration
def self.up
93
502070743.00569-01 12 01
t.column :name, :string
t.column :status_type, :string
t.column :user_selectable, :int
end
execute "INSERT INTO `ticketstatuses` VALUES (1, 'New', 'general', 0 )"
execute "INSERT INTO `ticketstatuses` VALUES (2, 'Resolved', 'general', 1)"
execute "INSERT INTO `ticketstatuses` VALUES (3, 'Priority-Low', 'general', 1)"
execute "INSERT INTO `ticketstatuses` VALUES (4, 'Priority-Medium', 'general', 1)"
execute "INSERT INTO `ticketstatuses` VALUES (5, 'Priority-High', 'general', 1)"
end
def self.down
drop_table :ticketstatuses
end
end
#-------------------------------------------------------------------------------------008_create_ticketlogs.rb
class CreateTicketlogs < ActiveRecord::Migration
def self.up
create_table :ticketlogs do |t|
t.column :ticket_id, :int
t.column :user_id, :int
t.column :created_at, :datetime #this will get populated automatically
t.column :log_type, :string
t.column :log, :text
end
end
def self.down
drop_table :ticketlogs
end
end
#---------------------------------------------------------------------------------------009_create_sessions.rb
class CreateSessions < ActiveRecord::Migration
def self.up
create_table :sessions do |t|
t.column :session_id, :string
t.column :data, :text
t.column :updated_at, :datetime
end
add_index :sessions, :session_id
add_index :sessions, :updated_at
end
def self.down
drop_table :sessions
end
end
94
Исходный код моделей данных