From 817b8a98f22e5ce887c7199d5adfe47fe012aefa Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Fri, 17 Apr 2015 03:51:46 +0300 Subject: [PATCH] Remove several unneeded colums from events --- app/models/event.rb | 6 ------ app/models/track.rb | 1 - ...0417004249_remove_unneeded_columns_from_events.rb | 12 ++++++++++++ 3 files changed, 12 insertions(+), 7 deletions(-) create mode 100644 db/migrate/20150417004249_remove_unneeded_columns_from_events.rb diff --git a/app/models/event.rb b/app/models/event.rb index 27a26f7..97793cc 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -4,10 +4,4 @@ class Event < ActiveRecord::Base validates :abstract, presence: true validates :description, presence: true validates :agreement, acceptance: true - - private - - def self.inheritance_column - 'something' - end end diff --git a/app/models/track.rb b/app/models/track.rb index 3e9b598..7f5e7c2 100644 --- a/app/models/track.rb +++ b/app/models/track.rb @@ -1,6 +1,5 @@ class Track < ActiveRecord::Base belongs_to :conference - has_many :events, dependent: :destroy validates :name, presence: true validates :color, presence: true, format: {with: /\A#?[a-f0-9]{6}\z/i} diff --git a/db/migrate/20150417004249_remove_unneeded_columns_from_events.rb b/db/migrate/20150417004249_remove_unneeded_columns_from_events.rb new file mode 100644 index 0000000..49f9415 --- /dev/null +++ b/db/migrate/20150417004249_remove_unneeded_columns_from_events.rb @@ -0,0 +1,12 @@ +class RemoveUnneededColumnsFromEvents < ActiveRecord::Migration + def change + remove_index :events, name: :index_events_on_track_id, column: :track_id + remove_index :events, name: :index_events_on_type, column: :type + remove_index :events, name: :index_events_on_user_id, column: :user_id + + remove_column :events, :type, :string + remove_column :events, :state, :string + remove_column :events, :track_id, :integer + remove_column :events, :user_id, :integer + end +end