diff options
author | francis <francis> | 2007-09-10 18:58:42 +0000 |
---|---|---|
committer | francis <francis> | 2007-09-10 18:58:42 +0000 |
commit | 2f61ce926c4311ff95597c1c871081a1fb46a4d6 (patch) | |
tree | e59a0e989b31e51a6069c8426840ec4db95dc26b /db | |
parent | 022f7a0d72a7742875d9ba94ce33a4ec069d36dd (diff) |
Model for outgoing messages.
Save body of initial request as an outgoing message.
Try and validate and save the pair of models correctly.
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/009_create_outgoing_messages.rb | 20 | ||||
-rw-r--r-- | db/schema.rb | 12 |
2 files changed, 31 insertions, 1 deletions
diff --git a/db/migrate/009_create_outgoing_messages.rb b/db/migrate/009_create_outgoing_messages.rb new file mode 100644 index 000000000..62bf25392 --- /dev/null +++ b/db/migrate/009_create_outgoing_messages.rb @@ -0,0 +1,20 @@ +class CreateOutgoingMessages < ActiveRecord::Migration + def self.up + create_table :outgoing_messages do |t| + t.column :info_request_id, :integer + + t.column :body, :text + t.column :status, :string + + t.column :public_body_id, :integer + t.column :message_type, :string + + t.column :created_at, :datetime + t.column :updated_at, :datetime + end + end + + def self.down + drop_table :outgoing_messages + end +end diff --git a/db/schema.rb b/db/schema.rb index 08043cd76..a0e867be9 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,7 +2,7 @@ # migrations feature of ActiveRecord to incrementally modify your database, and # then regenerate this schema definition. -ActiveRecord::Schema.define(:version => 8) do +ActiveRecord::Schema.define(:version => 9) do create_table "info_requests", :force => true do |t| t.column "title", :text @@ -10,6 +10,16 @@ ActiveRecord::Schema.define(:version => 8) do t.column "public_body_id", :integer end + create_table "outgoing_messages", :force => true do |t| + t.column "info_request_id", :integer + t.column "body", :text + t.column "status", :string + t.column "public_body_id", :integer + t.column "message_type", :string + t.column "created_at", :datetime + t.column "updated_at", :datetime + end + create_table "public_bodies", :force => true do |t| t.column "name", :text t.column "short_name", :text |