Remove several unneeded colums from events

This commit is contained in:
Petko Bordjukov 2015-04-17 03:51:46 +03:00
parent 6ee3195bef
commit 817b8a98f2
3 changed files with 12 additions and 7 deletions

View File

@ -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

View File

@ -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}

View File

@ -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