Inherit from ActiveRecord::Migration[4.2]

This commit is contained in:
Petko Bordjukov 2019-04-28 11:56:16 +03:00
parent c95a0c8d4b
commit 6f627d34d6
67 changed files with 67 additions and 67 deletions

View File

@ -1,4 +1,4 @@
class DeviseCreateUsers < ActiveRecord::Migration
class DeviseCreateUsers < ActiveRecord::Migration[4.2]
def change
create_table(:users) do |t|
## Database authenticatable

View File

@ -1,4 +1,4 @@
class CreateSpeakerProfiles < ActiveRecord::Migration
class CreateSpeakerProfiles < ActiveRecord::Migration[4.2]
def change
create_table :speaker_profiles do |t|
t.string :first_name

View File

@ -1,4 +1,4 @@
class RemoveSpeakerProfileColumnsFromUsers < ActiveRecord::Migration
class RemoveSpeakerProfileColumnsFromUsers < ActiveRecord::Migration[4.2]
def change
remove_column :users, :first_name, :string
remove_column :users, :last_name, :string

View File

@ -1,4 +1,4 @@
class AddUserReferenceToSpeakerProfiles < ActiveRecord::Migration
class AddUserReferenceToSpeakerProfiles < ActiveRecord::Migration[4.2]
def change
add_reference :speaker_profiles, :user, index: true
end

View File

@ -1,4 +1,4 @@
class CreateConferences < ActiveRecord::Migration
class CreateConferences < ActiveRecord::Migration[4.2]
def change
create_table :conferences do |t|
t.string :title, null: false

View File

@ -1,4 +1,4 @@
class CreateTracks < ActiveRecord::Migration
class CreateTracks < ActiveRecord::Migration[4.2]
def change
create_table :tracks do |t|
t.string :name, null: false

View File

@ -1,4 +1,4 @@
class CreateEvents < ActiveRecord::Migration
class CreateEvents < ActiveRecord::Migration[4.2]
def change
create_table :events do |t|
t.string :title, null: false

View File

@ -1,4 +1,4 @@
class RenamePictureUrlToPictureInSpeakerProfiles < ActiveRecord::Migration
class RenamePictureUrlToPictureInSpeakerProfiles < ActiveRecord::Migration[4.2]
def change
rename_column :speaker_profiles, :photo_url, :picture
end

View File

@ -1,4 +1,4 @@
class AddTranslationTablesToConferences < ActiveRecord::Migration
class AddTranslationTablesToConferences < ActiveRecord::Migration[4.2]
def up
Conference.create_translation_table!({
:title => :string,

View File

@ -1,4 +1,4 @@
class AddAdminFlagToUsers < ActiveRecord::Migration
class AddAdminFlagToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :admin, :boolean, null: false, default: false
end

View File

@ -1,4 +1,4 @@
class AddDescriptionToTracks < ActiveRecord::Migration
class AddDescriptionToTracks < ActiveRecord::Migration[4.2]
def change
add_column :tracks, :description, :text
end

View File

@ -1,4 +1,4 @@
class AddTranslationTablesToTracks < ActiveRecord::Migration
class AddTranslationTablesToTracks < ActiveRecord::Migration[4.2]
def up
Track.create_translation_table!({
name: :string,

View File

@ -1,4 +1,4 @@
class ChangeEventStateDefaults < ActiveRecord::Migration
class ChangeEventStateDefaults < ActiveRecord::Migration[4.2]
def up
execute 'UPDATE events SET state = 0'
change_column :events, :state, :integer, null: false, default: 0

View File

@ -1,4 +1,4 @@
class CreateHalls < ActiveRecord::Migration
class CreateHalls < ActiveRecord::Migration[4.2]
def change
create_table :halls do |t|
t.references :conference, index: true

View File

@ -1,4 +1,4 @@
class CreateSlots < ActiveRecord::Migration
class CreateSlots < ActiveRecord::Migration[4.2]
def change
create_table :slots do |t|
t.references :hall, index: true

View File

@ -1,4 +1,4 @@
class AddAcceptanceEmailFieldsToEvents < ActiveRecord::Migration
class AddAcceptanceEmailFieldsToEvents < ActiveRecord::Migration[4.2]
def change
add_column :events, :acceptance_notification_sent_at, :timestamp
add_column :events, :confirmed_at, :timestamp

View File

@ -1,4 +1,4 @@
class CreateEventsToSpeakersJoinTable < ActiveRecord::Migration
class CreateEventsToSpeakersJoinTable < ActiveRecord::Migration[4.2]
def up
create_join_table :events, :speaker_profiles
Event.all.each do |event|

View File

@ -1,4 +1,4 @@
class AddCallForPapersStatusToConferences < ActiveRecord::Migration
class AddCallForPapersStatusToConferences < ActiveRecord::Migration[4.2]
def change
add_column :conferences, :call_for_papers_open, :boolean
end

View File

@ -1,4 +1,4 @@
class CreatePropositions < ActiveRecord::Migration
class CreatePropositions < ActiveRecord::Migration[4.2]
def change
create_table :propositions do |t|
t.references :proposer, index: true

View File

@ -1,4 +1,4 @@
class CreatePropositionsForExistingEvents < ActiveRecord::Migration
class CreatePropositionsForExistingEvents < ActiveRecord::Migration[4.2]
def up
events = execute 'SELECT * FROM events'

View File

@ -1,4 +1,4 @@
class RemoveNotNullConstraintOnConferenceTitle < ActiveRecord::Migration
class RemoveNotNullConstraintOnConferenceTitle < ActiveRecord::Migration[4.2]
def change
change_column :conferences, :title, :string, null: true
end

View File

@ -1,4 +1,4 @@
class RemoveNotNullConstraintOnConferenceDescription < ActiveRecord::Migration
class RemoveNotNullConstraintOnConferenceDescription < ActiveRecord::Migration[4.2]
def change
change_column :conferences, :description, :text, null: true
end

View File

@ -1,4 +1,4 @@
class RemoveNotNullConstraintOnTrackName < ActiveRecord::Migration
class RemoveNotNullConstraintOnTrackName < ActiveRecord::Migration[4.2]
def change
change_column :tracks, :name, :text, null: true
end

View File

@ -1,4 +1,4 @@
class CreateEventTypes < ActiveRecord::Migration
class CreateEventTypes < ActiveRecord::Migration[4.2]
def up
create_table :event_types do |t|
t.references :conference, index: true, foreign_key: true

View File

@ -1,7 +1,7 @@
class EventType < ActiveRecord::Base
end
class CreateEventTypesForAllExistingEvents < ActiveRecord::Migration
class CreateEventTypesForAllExistingEvents < ActiveRecord::Migration[4.2]
def up
event_types = execute 'SELECT events.type AS type_name, tracks.conference_id, MIN(events.created_at) AS created_at FROM events
INNER JOIN tracks ON tracks.id = events.track_id

View File

@ -1,4 +1,4 @@
class AddEventTypeToEvents < ActiveRecord::Migration
class AddEventTypeToEvents < ActiveRecord::Migration[4.2]
def change
add_reference :events, :event_type, index: true, foreign_key: true
end

View File

@ -1,4 +1,4 @@
class PopulateEventTypeOfExistingEvents < ActiveRecord::Migration
class PopulateEventTypeOfExistingEvents < ActiveRecord::Migration[4.2]
def up
event_ids = execute('SELECT id FROM events WHERE type IS NOT NULL;').map { |row| row['id'] };

View File

@ -1,4 +1,4 @@
class RemoveUnneededColumnsFromEvents < ActiveRecord::Migration
class RemoveUnneededColumnsFromEvents < ActiveRecord::Migration[4.2]
def change
remove_index :events, name: :index_events_on_track_id, column: :track_id
remove_index :events, name: :index_events_on_type, column: :type

View File

@ -1,4 +1,4 @@
class CreateCallForParticipations < ActiveRecord::Migration
class CreateCallForParticipations < ActiveRecord::Migration[4.2]
def change
create_table :call_for_participations do |t|
t.references :conference, index: true, foreign_key: true

View File

@ -1,7 +1,7 @@
class Conference < ActiveRecord::Base; end
class CallForParticipation < ActiveRecord::Base; end
class CreateCallForParticipationRecords < ActiveRecord::Migration
class CreateCallForParticipationRecords < ActiveRecord::Migration[4.2]
def change
Conference.all.each do |c|
CallForParticipation.create!(conference_id: c.id)

View File

@ -1,4 +1,4 @@
class RenameSpeakerProfilesToPersonalProfiles < ActiveRecord::Migration
class RenameSpeakerProfilesToPersonalProfiles < ActiveRecord::Migration[4.2]
def change
rename_table :speaker_profiles, :personal_profiles
end

View File

@ -1,4 +1,4 @@
class AddConferenceIdToPersonalProfiles < ActiveRecord::Migration
class AddConferenceIdToPersonalProfiles < ActiveRecord::Migration[4.2]
def change
add_column :personal_profiles, :conference_id, :integer
add_index :personal_profiles, :conference_id

View File

@ -4,7 +4,7 @@ end
class PersonalProfile < ActiveRecord::Base
end
class PopulateConferenceIdInPersonalProfiles < ActiveRecord::Migration
class PopulateConferenceIdInPersonalProfiles < ActiveRecord::Migration[4.2]
def change
conference = Conference.first

View File

@ -1,4 +1,4 @@
class AddSlugToConferences < ActiveRecord::Migration
class AddSlugToConferences < ActiveRecord::Migration[4.2]
def change
add_column :conferences, :slug, :string
add_index :conferences, :slug

View File

@ -1,4 +1,4 @@
class RemoveSlugFromConferences < ActiveRecord::Migration
class RemoveSlugFromConferences < ActiveRecord::Migration[4.2]
def change
remove_column :conferences, :slug
end

View File

@ -1,4 +1,4 @@
class AddDescriptionToEventTypes < ActiveRecord::Migration
class AddDescriptionToEventTypes < ActiveRecord::Migration[4.2]
def change
add_column :event_types, :description, :text
end

View File

@ -1,4 +1,4 @@
class CreateParticipations < ActiveRecord::Migration
class CreateParticipations < ActiveRecord::Migration[4.2]
def change
create_table :participations do |t|
t.references :participant, index: true

View File

@ -1,7 +1,7 @@
class Participation < ActiveRecord::Base; end
class PersonalProfile < ActiveRecord::Base; end
class CreateParticipationRecords < ActiveRecord::Migration
class CreateParticipationRecords < ActiveRecord::Migration[4.2]
def up
event_to_speaker_profiles = execute 'SELECT * FROM events_speaker_profiles'

View File

@ -1,4 +1,4 @@
class DropJoinTableEventsSepakerProfiles < ActiveRecord::Migration
class DropJoinTableEventsSepakerProfiles < ActiveRecord::Migration[4.2]
def up
drop_table :events_speaker_profiles
end

View File

@ -1,4 +1,4 @@
class AddLanguageToUsers < ActiveRecord::Migration
class AddLanguageToUsers < ActiveRecord::Migration[4.2]
def change
add_column :users, :language, :string
end

View File

@ -10,7 +10,7 @@ end
class Track < ActiveRecord::Base
end
class AddConferenceIdToEvents < ActiveRecord::Migration
class AddConferenceIdToEvents < ActiveRecord::Migration[4.2]
def up
add_reference :events, :conference, index: true, foreign_key: true

View File

@ -6,7 +6,7 @@ class Proposition < ActiveRecord::Base
belongs_to :proposable, polymorphic: true
end
class AddTrackIdToEvents < ActiveRecord::Migration
class AddTrackIdToEvents < ActiveRecord::Migration[4.2]
def up
add_reference :events, :track, index: true, foreign_key: true

View File

@ -1,4 +1,4 @@
class RemovePropositionAcceptingFieldsFromPropositions < ActiveRecord::Migration
class RemovePropositionAcceptingFieldsFromPropositions < ActiveRecord::Migration[4.2]
def change
remove_reference :propositions, :proposition_accepting, index: true, polymorphic: true
end

View File

@ -1,4 +1,4 @@
class AddHostNameToConferences < ActiveRecord::Migration
class AddHostNameToConferences < ActiveRecord::Migration[4.2]
def change
add_column :conferences, :host_name, :string
add_index :conferences, :host_name

View File

@ -1,4 +1,4 @@
class AddTimeLimitsToEventTypes < ActiveRecord::Migration
class AddTimeLimitsToEventTypes < ActiveRecord::Migration[4.2]
def change
add_column :event_types, :minimum_length, :integer
add_column :event_types, :maximum_length, :integer

View File

@ -1,4 +1,4 @@
class DropDefaultValueForLengthInEvents < ActiveRecord::Migration
class DropDefaultValueForLengthInEvents < ActiveRecord::Migration[4.2]
def change
change_column_default(:events, :length, nil)
end

View File

@ -1,4 +1,4 @@
class CreateVolunteerTeams < ActiveRecord::Migration
class CreateVolunteerTeams < ActiveRecord::Migration[4.2]
def up
create_table :volunteer_teams do |t|
t.references :conference, index: true, foreign_key: true

View File

@ -1,4 +1,4 @@
class CreateVolunteerships < ActiveRecord::Migration
class CreateVolunteerships < ActiveRecord::Migration[4.2]
def change
create_table :volunteerships do |t|
t.references :volunteer_team, index: true, foreign_key: true

View File

@ -1,4 +1,4 @@
class AddCssClassToTracks < ActiveRecord::Migration
class AddCssClassToTracks < ActiveRecord::Migration[4.2]
def change
add_column :tracks, :css_class, :string
end

View File

@ -1,4 +1,4 @@
class AddCssStyleStringToTracks < ActiveRecord::Migration
class AddCssStyleStringToTracks < ActiveRecord::Migration[4.2]
def change
add_column :tracks, :css_style, :text
end

View File

@ -1,4 +1,4 @@
class AddForegroundColorToTracks < ActiveRecord::Migration
class AddForegroundColorToTracks < ActiveRecord::Migration[4.2]
def change
add_column :tracks, :foreground_color, :string
end

View File

@ -1,4 +1,4 @@
class AddConfirmedAtToPropositions < ActiveRecord::Migration
class AddConfirmedAtToPropositions < ActiveRecord::Migration[4.2]
def change
add_column :propositions, :confirmed_at, :timestamp
end

View File

@ -2,7 +2,7 @@ class Event < ActiveRecord::Base
include Proposable
end
class PopulateConfirmedAtOfPropositionsForEvents < ActiveRecord::Migration
class PopulateConfirmedAtOfPropositionsForEvents < ActiveRecord::Migration[4.2]
def up
Event.all do |event|
event.proposition.update(confirmed_at: event.confirmed_at)

View File

@ -1,4 +1,4 @@
class RemoveConfirmedAtFromEvents < ActiveRecord::Migration
class RemoveConfirmedAtFromEvents < ActiveRecord::Migration[4.2]
def change
remove_column :events, :confirmed_at, :timestamp
end

View File

@ -1,4 +1,4 @@
class AddTranslationsToHalls < ActiveRecord::Migration
class AddTranslationsToHalls < ActiveRecord::Migration[4.2]
def self.up
Hall.create_translation_table!({
:name => :string

View File

@ -1,4 +1,4 @@
class CreateVolunteers < ActiveRecord::Migration
class CreateVolunteers < ActiveRecord::Migration[4.2]
def change
create_table :volunteers do |t|
t.string :name

View File

@ -1,4 +1,4 @@
class CreateJoinTableVolunteerVolunteerTeam < ActiveRecord::Migration
class CreateJoinTableVolunteerVolunteerTeam < ActiveRecord::Migration[4.2]
def change
create_join_table :volunteers, :volunteer_teams do |t|
t.index [:volunteer_id, :volunteer_team_id], name: 'volunteer_id_volunteer_team_id'

View File

@ -1,4 +1,4 @@
class AddConferenceIdToVolunteers < ActiveRecord::Migration
class AddConferenceIdToVolunteers < ActiveRecord::Migration[4.2]
def change
add_reference :volunteers, :conference, index: true, foreign_key: true
end

View File

@ -1,4 +1,4 @@
class AddLanguageToVolunteers < ActiveRecord::Migration
class AddLanguageToVolunteers < ActiveRecord::Migration[4.2]
def change
add_column :volunteers, :language, :string
end

View File

@ -1,4 +1,4 @@
class AddPlannedCfpEndDateToConferences < ActiveRecord::Migration
class AddPlannedCfpEndDateToConferences < ActiveRecord::Migration[4.2]
def change
add_column :conferences, :planned_cfp_end_date, :date
end

View File

@ -1,4 +1,4 @@
class AddVoteDataToConferences < ActiveRecord::Migration
class AddVoteDataToConferences < ActiveRecord::Migration[4.2]
def change
add_column :conferences, :vote_data_endpoint, :string
add_column :conferences, :number_of_ballots_cast, :integer

View File

@ -1,4 +1,4 @@
class AddVoteDataToEvents < ActiveRecord::Migration
class AddVoteDataToEvents < ActiveRecord::Migration[4.2]
def change
add_column :events, :number_of_votes, :integer
add_column :events, :rank, :integer

View File

@ -1,7 +1,7 @@
class EventType < ActiveRecord::Base
end
class SetMinimalAndMaximalTimesForAllEventTypes < ActiveRecord::Migration
class SetMinimalAndMaximalTimesForAllEventTypes < ActiveRecord::Migration[4.2]
def up
EventType.where(minimum_length: nil).update_all(minimum_length: 0)
EventType.where(maximum_length: nil).update_all(maximum_length: 240)

View File

@ -1,7 +1,7 @@
class Event < ActiveRecord::Base
end
class AddDescriptionsForAllEvents < ActiveRecord::Migration
class AddDescriptionsForAllEvents < ActiveRecord::Migration[4.2]
def up
Event.where(description: [nil, '']).update_all(description: 'n/a')
end

View File

@ -1,4 +1,4 @@
class CreateConflictCounts < ActiveRecord::Migration
class CreateConflictCounts < ActiveRecord::Migration[4.2]
def change
create_table :conflict_counts do |t|
t.references :left, index: true

View File

@ -13,7 +13,7 @@ LEFT JOIN "personal_profiles" ON "personal_profiles"."conference_id" = "events"
AND "personal_profiles"."user_id" = "users"."id";
EOS
class AddParticipantsView < ActiveRecord::Migration
class AddParticipantsView < ActiveRecord::Migration[4.2]
def up
execute PARTICIPANTS_SQL
end

View File

@ -1,4 +1,4 @@
class CreateFeedbacks < ActiveRecord::Migration
class CreateFeedbacks < ActiveRecord::Migration[4.2]
def change
create_table :feedbacks do |t|
t.references :feedback_receiving, index: {name: :feedbacks_polymorphic_index}, polymorphic: true, null: false