foodsoft/plugins/messages/db/migrate/20090120184410_create_messages.rb.skip

25 lines
837 B
Text
Raw Normal View History

2014-06-23 17:50:51 +02:00
# This migration has a ".skip" suffix to prevent it from being recognised as
# a migration. While this migration is relevant for the messages plugin, it
# was already included in stock foodsoft when messages were part of its core.
# `rake db:install:migrations` would install this migration, resulting in an
# attempt to create an already existing messages table.
#
2014-03-07 09:51:24 +01:00
# extracted from 20090120184410_road_to_version_three.rb
class CreateMessages < ActiveRecord::Migration[4.2]
2014-03-07 09:51:24 +01:00
def self.up
create_table :messages do |t|
t.references :sender
t.text :recipients_ids
t.string :subject, :null => false
t.text :body
t.integer :email_state, :default => 0, :null => false
t.boolean :private, :default => false
t.datetime :created_at
end
end
def self.down
drop_table :messages
end
end