Skip to content

Commit

Permalink
Add full timestamps to all tables
Browse files Browse the repository at this point in the history
Its convention to include these on all tables, so its really confusing
when they don't exist.

Initially we're setting them to allow `NULL` values so that we can write
and run a data population task without the records being invalid. We'll
then fixup these with a `null: false` constraint.
  • Loading branch information
garethrees committed Apr 19, 2018
1 parent ac83709 commit 80b12bb
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 0 deletions.
@@ -0,0 +1,6 @@
# -*- encoding : utf-8 -*-
class AddTimestampsToFoiAttachments < ActiveRecord::Migration
def change
add_timestamps(:foi_attachments)
end
end
6 changes: 6 additions & 0 deletions db/migrate/20180418154949_add_timestamps_to_holidays.rb
@@ -0,0 +1,6 @@
# -*- encoding : utf-8 -*-
class AddTimestampsToHolidays < ActiveRecord::Migration
def change
add_timestamps(:holidays)
end
end
10 changes: 10 additions & 0 deletions db/migrate/20180418155130_add_updated_at_to_info_request_events.rb
@@ -0,0 +1,10 @@
# -*- encoding : utf-8 -*-
class AddUpdatedAtToInfoRequestEvents < ActiveRecord::Migration
def up
add_column :info_request_events, :updated_at, :datetime
end

def down
remove_column :info_request_events, :updated_at
end
end
6 changes: 6 additions & 0 deletions db/migrate/20180418155632_add_timestamps_to_profile_photos.rb
@@ -0,0 +1,6 @@
# -*- encoding : utf-8 -*-
class AddTimestampsToProfilePhotos < ActiveRecord::Migration
def change
add_timestamps(:profile_photos)
end
end
@@ -0,0 +1,6 @@
# -*- encoding : utf-8 -*-
class AddTimestampsToPublicBodyCategoryLinks < ActiveRecord::Migration
def change
add_timestamps(:public_body_category_links)
end
end
@@ -0,0 +1,6 @@
# -*- encoding : utf-8 -*-
class AddTimestampsToPublicBodyCategories < ActiveRecord::Migration
def change
add_timestamps(:public_body_categories)
end
end
@@ -0,0 +1,6 @@
# -*- encoding : utf-8 -*-
class AddTimestampsToPublicBodyHeadings < ActiveRecord::Migration
def change
add_timestamps(:public_body_headings)
end
end
6 changes: 6 additions & 0 deletions db/migrate/20180418160048_add_timestamps_to_raw_emails.rb
@@ -0,0 +1,6 @@
# -*- encoding : utf-8 -*-
class AddTimestampsToRawEmails < ActiveRecord::Migration
def change
add_timestamps(:raw_emails)
end
end
@@ -0,0 +1,6 @@
# -*- encoding : utf-8 -*-
class AddTimestampsToUserInfoRequestSentAlerts < ActiveRecord::Migration
def change
add_timestamps(:user_info_request_sent_alerts)
end
end
10 changes: 10 additions & 0 deletions db/migrate/20180418160205_add_updated_at_to_has_tag_string_tags.rb
@@ -0,0 +1,10 @@
# -*- encoding : utf-8 -*-
class AddUpdatedAtToHasTagStringTags < ActiveRecord::Migration
def up
add_column :has_tag_string_tags, :updated_at, :datetime
end

def down
remove_column :has_tag_string_tags, :updated_at
end
end
@@ -0,0 +1,6 @@
# -*- encoding : utf-8 -*-
class AddTimestampsToActsAsXapianJobs < ActiveRecord::Migration
def change
add_timestamps(:acts_as_xapian_jobs)
end
end

0 comments on commit 80b12bb

Please sign in to comment.