aboutsummaryrefslogtreecommitdiffstats
path: root/db
diff options
context:
space:
mode:
Diffstat (limited to 'db')
-rw-r--r--db/migrate/050_improve_track_things.rb25
-rw-r--r--db/schema.rb44
2 files changed, 50 insertions, 19 deletions
diff --git a/db/migrate/050_improve_track_things.rb b/db/migrate/050_improve_track_things.rb
new file mode 100644
index 000000000..7750dcf14
--- /dev/null
+++ b/db/migrate/050_improve_track_things.rb
@@ -0,0 +1,25 @@
+class ImproveTrackThings < ActiveRecord::Migration
+ def self.up
+ add_column :track_things, :track_type, :string, :null => false
+
+ add_column :track_things, :created_at, :datetime
+ add_column :track_things, :updated_at, :datetime
+ add_column :track_things_sent_emails, :created_at, :datetime
+ add_column :track_things_sent_emails, :updated_at, :datetime
+
+ add_column :users, :last_daily_track_email, :datetime
+ User.update_all "last_daily_track_email = '2000-01-01'"
+ change_column :users, :last_daily_track_email, :datetime, :default => "2000-01-01"
+ end
+
+ def self.down
+ remove_column :track_things, :track_type
+
+ remove_column :track_things, :created_at
+ remove_column :track_things, :updated_at
+ remove_column :track_things_sent_emails, :created_at
+ remove_column :track_things_sent_emails, :updated_at
+
+ remove_column :users, :last_daily_track_email
+ end
+end
diff --git a/db/schema.rb b/db/schema.rb
index e800b916d..33e01f82d 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -9,7 +9,7 @@
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 49) do
+ActiveRecord::Schema.define(:version => 50) do
create_table "incoming_messages", :force => true do |t|
t.integer "info_request_id", :null => false
@@ -118,19 +118,24 @@ ActiveRecord::Schema.define(:version => 49) do
add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
create_table "track_things", :force => true do |t|
- t.integer "tracking_user_id", :null => false
- t.string "track_query", :null => false
- t.integer "info_request_id"
- t.integer "tracked_user_id"
- t.integer "public_body_id"
- t.string "track_medium", :null => false
+ t.integer "tracking_user_id", :null => false
+ t.string "track_query", :null => false
+ t.integer "info_request_id"
+ t.integer "tracked_user_id"
+ t.integer "public_body_id"
+ t.string "track_medium", :null => false
+ t.string "track_type", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
create_table "track_things_sent_emails", :force => true do |t|
- t.integer "track_thing_id", :null => false
- t.integer "info_request_event_id"
- t.integer "user_id"
- t.integer "public_body_id"
+ t.integer "track_thing_id", :null => false
+ t.integer "info_request_event_id"
+ t.integer "user_id"
+ t.integer "public_body_id"
+ t.datetime "created_at"
+ t.datetime "updated_at"
end
create_table "user_info_request_sent_alerts", :force => true do |t|
@@ -143,14 +148,15 @@ ActiveRecord::Schema.define(:version => 49) do
add_index "user_info_request_sent_alerts", ["user_id", "info_request_id", "alert_type"], :name => "user_info_request_sent_alerts_unique_index", :unique => true
create_table "users", :force => true do |t|
- t.string "email", :null => false
- t.string "name", :null => false
- t.string "hashed_password", :null => false
- t.string "salt", :null => false
- t.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
- t.boolean "email_confirmed", :default => false, :null => false
- t.text "url_name", :null => false
+ t.string "email", :null => false
+ t.string "name", :null => false
+ t.string "hashed_password", :null => false
+ t.string "salt", :null => false
+ t.datetime "created_at", :null => false
+ t.datetime "updated_at", :null => false
+ t.boolean "email_confirmed", :default => false, :null => false
+ t.text "url_name", :null => false
+ t.datetime "last_daily_track_email", :default => '2000-01-01 00:00:00'
end
add_index "users", ["url_name"], :name => "index_users_on_url_name", :unique => true