Skip to content

Commit 2cb9c20

Browse files
committed
fixing 6.1 migration files for test against 5.2
1 parent b6c90d4 commit 2cb9c20

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed
Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This migration comes from active_storage (originally 20190112182829)
2-
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
3-
def up
4-
if Rails::VERSION::MAJOR >= 6 && Rails::VERSION::MINOR >= 1
2+
if Rails::VERSION::MAJOR >= 6 && Rails::VERSION::MINOR >= 1
3+
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
4+
def up
55
unless column_exists?(:active_storage_blobs, :service_name)
66
add_column :active_storage_blobs, :service_name, :string
77

@@ -12,11 +12,19 @@ def up
1212
change_column :active_storage_blobs, :service_name, :string, null: false
1313
end
1414
end
15-
end
1615

17-
def down
18-
if Rails::VERSION::MAJOR >= 6 && Rails::VERSION::MINOR >= 1
16+
def down
1917
remove_column :active_storage_blobs, :service_name
2018
end
2119
end
20+
else
21+
class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[5.2]
22+
def up
23+
24+
end
25+
26+
def down
27+
28+
end
29+
end
2230
end
Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This migration comes from active_storage (originally 20191206030411)
2-
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
3-
def change
4-
if Rails::VERSION::MAJOR >= 6 && Rails::VERSION::MINOR >= 1
2+
if Rails::VERSION::MAJOR >= 6 && Rails::VERSION::MINOR >= 1
3+
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
4+
def change
55
create_table :active_storage_variant_records do |t|
66
t.belongs_to :blob, null: false, index: false
77
t.string :variation_digest, null: false
@@ -11,4 +11,10 @@ def change
1111
end
1212
end
1313
end
14+
else
15+
class CreateActiveStorageVariantRecords < ActiveRecord::Migration[5.2]
16+
def change
17+
18+
end
19+
end
1420
end

0 commit comments

Comments
 (0)