Remove several unneeded colums from events
This commit is contained in:
parent
6ee3195bef
commit
817b8a98f2
|
@ -4,10 +4,4 @@ class Event < ActiveRecord::Base
|
||||||
validates :abstract, presence: true
|
validates :abstract, presence: true
|
||||||
validates :description, presence: true
|
validates :description, presence: true
|
||||||
validates :agreement, acceptance: true
|
validates :agreement, acceptance: true
|
||||||
|
|
||||||
private
|
|
||||||
|
|
||||||
def self.inheritance_column
|
|
||||||
'something'
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
class Track < ActiveRecord::Base
|
class Track < ActiveRecord::Base
|
||||||
belongs_to :conference
|
belongs_to :conference
|
||||||
has_many :events, dependent: :destroy
|
|
||||||
|
|
||||||
validates :name, presence: true
|
validates :name, presence: true
|
||||||
validates :color, presence: true, format: {with: /\A#?[a-f0-9]{6}\z/i}
|
validates :color, presence: true, format: {with: /\A#?[a-f0-9]{6}\z/i}
|
||||||
|
|
|
@ -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
|
Loading…
Reference in New Issue