2020-08-07 01:14:14 +02:00
|
|
|
class AddMessaging < ActiveRecord::Migration[4.2]
|
2009-01-06 11:49:19 +01:00
|
|
|
def self.up
|
|
|
|
# Table that holds the messages:
|
|
|
|
create_table :messages do |t|
|
|
|
|
t.column :sender_id, :integer
|
2023-05-12 13:01:12 +02:00
|
|
|
t.column :recipient_id, :integer, null: false
|
|
|
|
t.column :recipients, :string, null: false
|
|
|
|
t.column :subject, :string, null: false
|
|
|
|
t.column :body, :text, null: false
|
|
|
|
t.column :read, :boolean, null: false, default: false
|
|
|
|
t.column :email_state, :integer, null: false
|
|
|
|
t.column :created_on, :timestamp, null: false
|
2009-01-06 11:49:19 +01:00
|
|
|
end
|
|
|
|
add_index(:messages, :sender_id)
|
|
|
|
add_index(:messages, :recipient_id)
|
2021-03-01 15:27:26 +01:00
|
|
|
|
2009-01-06 11:49:19 +01:00
|
|
|
# Setup acts_as_configurable plugin for user options etc.
|
|
|
|
ConfigurableSetting.create_table
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.down
|
|
|
|
drop_table :messages
|
|
|
|
ConfigurableSetting.drop_table
|
|
|
|
end
|
|
|
|
end
|