mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Annotate past migrations with Rails version
Many migrations currently fail to run with:
> Directly inheriting from ActiveRecord::Migration is not supported.
> Please specify the Rails release the migration was written for:
>
> class Example < ActiveRecord::Migration[4.2]
I've annotated those that I need to run with the Rails version at the
time each was committed:
rake db:migrate:status \
| grep --perl-regexp --only-matching '(?<=^ down )\d{14}' \
| while read -r id; do
path="$(ls -1 db/migrate/${id}_*.rb)"
version="$(git show "$(git log --diff-filter=A --pretty=format:%H -- "$path")":Gemfile.lock \
| grep --perl-regexp --only-matching '(?<=^ rails \()\d+\.\d+(?=(\.\d+)+\))')"
sed --in-place -e "s/\(< ActiveRecord::Migration\)$/\\1[$version]/" "$path"
done
This commit is contained in:
parent
2051540693
commit
5a890013ef
32 changed files with 32 additions and 32 deletions
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateSurveys < ActiveRecord::Migration
|
||||
class CreateSurveys < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :surveys do |t|
|
||||
t.datetime :start_date
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateSurveyQuestions < ActiveRecord::Migration
|
||||
class CreateSurveyQuestions < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :survey_questions do |t|
|
||||
t.references :survey
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddTargetToSurveys < ActiveRecord::Migration
|
||||
class AddTargetToSurveys < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
add_column :surveys, :target, :integer, default: 0
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateSurveyReplies < ActiveRecord::Migration
|
||||
class CreateSurveyReplies < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :survey_replies do |t|
|
||||
t.integer :survey_question_id
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateSurveySubmissions < ActiveRecord::Migration
|
||||
class CreateSurveySubmissions < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :survey_submissions do |t|
|
||||
t.integer :user_id
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddCommentsCountToEvents < ActiveRecord::Migration
|
||||
class AddCommentsCountToEvents < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :events, :comments_count, :integer, default: 0, null: false
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDefaultToRevisionInConference < ActiveRecord::Migration
|
||||
class AddDefaultToRevisionInConference < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
change_column :conferences, :revision, :integer, default: 0, null: false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddEnabledToEventSchedules < ActiveRecord::Migration
|
||||
class AddEnabledToEventSchedules < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
add_column :event_schedules, :enabled, :boolean, default: true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateBooths < ActiveRecord::Migration
|
||||
class CreateBooths < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :booths do |t|
|
||||
t.string :title
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddTypeToCfps < ActiveRecord::Migration
|
||||
class AddTypeToCfps < ActiveRecord::Migration[4.2]
|
||||
class TmpCfp < ActiveRecord::Base
|
||||
self.table_name = 'cfps'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateBoothRequests < ActiveRecord::Migration
|
||||
class CreateBoothRequests < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :booth_requests do |t|
|
||||
t.references :booth, index: true, foreign_key: true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreatePhysicalTickets < ActiveRecord::Migration
|
||||
class CreatePhysicalTickets < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :physical_tickets do |t|
|
||||
t.integer :ticket_purchase_id, null: false
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddShortNameToTracks < ActiveRecord::Migration
|
||||
class AddShortNameToTracks < ActiveRecord::Migration[4.2]
|
||||
class TmpProgram < ActiveRecord::Base
|
||||
self.table_name = 'programs'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddTicketLayoutToConferences < ActiveRecord::Migration
|
||||
class AddTicketLayoutToConferences < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :conferences, :ticket_layout, :integer, default: 0
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddStateCfpActiveAndSubmitterReferenceToTracks < ActiveRecord::Migration
|
||||
class AddStateCfpActiveAndSubmitterReferenceToTracks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :tracks, :state, :string
|
||||
add_column :tracks, :cfp_active, :boolean
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateTicketScannings < ActiveRecord::Migration
|
||||
class CreateTicketScannings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :ticket_scannings do |t|
|
||||
t.integer :physical_ticket_id, null: false
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRoomAndDatesToTracks < ActiveRecord::Migration
|
||||
class AddRoomAndDatesToTracks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :tracks, :room, index: true, foreign_key: true
|
||||
add_column :tracks, :start_date, :date
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MakeTrackStateNotNullAndAddDefaultValue < ActiveRecord::Migration
|
||||
class MakeTrackStateNotNullAndAddDefaultValue < ActiveRecord::Migration[4.2]
|
||||
class TmpTrack < ActiveRecord::Base
|
||||
self.table_name = 'tracks'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class MakeTrackCfpActiveNotNull < ActiveRecord::Migration
|
||||
class MakeTrackCfpActiveNotNull < ActiveRecord::Migration[4.2]
|
||||
class TmpTrack < ActiveRecord::Base
|
||||
self.table_name = 'tracks'
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIndexToPhysicalTickets < ActiveRecord::Migration
|
||||
class AddIndexToPhysicalTickets < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :physical_tickets, :token, :string
|
||||
add_index :physical_tickets, :token, unique: true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddCustomDomainToConferences < ActiveRecord::Migration
|
||||
class AddCustomDomainToConferences < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :conferences, :custom_domain, :string
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRelevanceToTracks < ActiveRecord::Migration
|
||||
class AddRelevanceToTracks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :tracks, :relevance, :text
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddIncludeBoothsToSplashpages < ActiveRecord::Migration
|
||||
class AddIncludeBoothsToSplashpages < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :splashpages, :include_booths, :boolean
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddBoothLimitToConferences < ActiveRecord::Migration
|
||||
class AddBoothLimitToConferences < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :conferences, :booth_limit, :integer, default: 0
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddBoothsToEmailSettings < ActiveRecord::Migration
|
||||
class AddBoothsToEmailSettings < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :email_settings, :send_on_booths_acceptance, :boolean, default: false
|
||||
add_column :email_settings, :booths_acceptance_subject, :string
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddRegistrationTicketToTickets < ActiveRecord::Migration
|
||||
class AddRegistrationTicketToTickets < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :tickets, :registration_ticket, :boolean, default: false
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddTrackReferenceToSchedule < ActiveRecord::Migration
|
||||
class AddTrackReferenceToSchedule < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_reference :schedules, :track, index: true, foreign_key: true
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddSelectedScheduleToTracks < ActiveRecord::Migration
|
||||
class AddSelectedScheduleToTracks < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :tracks, :selected_schedule_id, :integer
|
||||
add_index :tracks, :selected_schedule_id
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddDescriptionToCfps < ActiveRecord::Migration
|
||||
class AddDescriptionToCfps < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :cfps, :description, :text
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddAmountPaidToTicketPurchases < ActiveRecord::Migration
|
||||
class AddAmountPaidToTicketPurchases < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :ticket_purchases, :amount_paid, :float, default: 0
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class RebuildConferencePictures < ActiveRecord::Migration
|
||||
class RebuildConferencePictures < ActiveRecord::Migration[5.0]
|
||||
def up
|
||||
Conference.all.each do |conference|
|
||||
conference.picture.recreate_versions!
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class AddMastodonToContact < ActiveRecord::Migration
|
||||
class AddMastodonToContact < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
add_column :contacts, :mastodon, :string
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue