Skip to content
This repository was archived by the owner on Oct 29, 2024. It is now read-only.

Commit 44a890d

Browse files
cwillemsMrSerth
authored andcommitted
Fix paperclip migrations
1 parent 110b143 commit 44a890d

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

Diff for: db/migrate/20131111132906_add_avatar_to_chairs.rb

+10-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
11
class AddAvatarToChairs < ActiveRecord::Migration[4.2]
22
def up
3-
add_attachment :chairs, :avatar
3+
add_column :chairs, :avatar_file_name, :string
4+
add_column :chairs, :avatar_file_size, :integer
5+
add_column :chairs, :avatar_content_type, :string
6+
add_column :chairs, :avatar_updated_at, :datetime
47
end
58

6-
def down
7-
remove_attachment :chairs, :avatar
8-
end
9+
def down
10+
remove_column :chairs, :avatar_file_name, :string
11+
remove_column :chairs, :avatar_file_size, :integer
12+
remove_column :chairs, :avatar_content_type, :string
13+
remove_column :chairs, :avatar_updated_at, :datetime
14+
end
915
end
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
class AddAttachmentOfferAsPdfToJobOffers < ActiveRecord::Migration[4.2]
22
def self.up
3-
change_table :job_offers do |t|
4-
t.attachment :offer_as_pdf
5-
end
3+
add_column :job_offers, :offer_as_pdf_file_name, :string
4+
add_column :job_offers, :offer_as_pdf_file_size, :integer
5+
add_column :job_offers, :offer_as_pdf_content_type, :string
6+
add_column :job_offers, :offer_as_pdf_updated_at, :datetime
67
end
78

89
def self.down
9-
drop_attached_file :job_offers, :offer_as_pdf
10+
remove_column :job_offers, :offer_as_pdf_file_name, :string
11+
remove_column :job_offers, :offer_as_pdf_file_size, :integer
12+
remove_column :job_offers, :offer_as_pdf_content_type, :string
13+
remove_column :job_offers, :offer_as_pdf_updated_at, :datetime
1014
end
1115
end

0 commit comments

Comments
 (0)