Sha256: 8731be042de8c3cceac3a3c46dc5cf234a22eca6c994b4069d465d3f20558b10

Contents?: true

Size: 951 Bytes

Versions: 9

Compression:

Stored size: 951 Bytes

Contents

class CreateMessages < ActiveRecord::Migration
    def self.up
        create_table :messages do |t|
            # foreign key type things first
            t.column :mailinglist_id, :integer
            t.column :address_id, :integer
            t.column :parent_id, :integer

            # Now our own things
            t.column :subject,   :string    # just a Premature Optimization, I suspect
            t.column :messageid, :string    # not message_id--the message_id header from the MTA
            t.column :timestamp, :timestamp # Message timestamp (used for sorting)
            t.column :headers,   :text      # The text of the headers
            t.column :body,      :text      # The text of the body
        end
#         execute <<-'SQL'
#             ALTER TABLE addresses_mailinglists 
#                 ADD PRIMARY KEY ( address_id, mailinglist_id )
#         SQL
    end

    def self.down
        drop_table :messages
    end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
sugoi-mail-0.0.2 db/migrate/007_create_messages.rb
sugoi-mail-0.0.5 db/migrate/007_create_messages.rb
sugoi-mail-0.1.0 db/migrate/007_create_messages.rb
sugoi-mail-0.1.5 db/migrate/007_create_messages.rb
sugoi-mail-0.0.0 db/migrate/007_create_messages.rb
sugoi-mail-0.0.1 db/migrate/007_create_messages.rb
sugoi-mail-0.0.3 db/migrate/007_create_messages.rb
sugoi-mail-0.3.0 db/migrate/007_create_messages.rb
sugoi-mail-0.3.2 db/migrate/007_create_messages.rb