activestorage 6.1.6.1 → 6.1.7.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of activestorage might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8fb7344362927b3834f94b8e5cd2420f3c5060066804ccdedace833169d98bf1
4
- data.tar.gz: 0d3225047a9550eea6007f80b212ce28455795d55ecbfa0e902e480a048c7ceb
3
+ metadata.gz: 28766d80543e3e34b07e2603f1f04b0efc2ebd5738b1ab84ebbe12d5494eae35
4
+ data.tar.gz: 5841c3af1c22f5f9ff2a7c5129e2902b5ebcaee41666d363568b8fe4727e484c
5
5
  SHA512:
6
- metadata.gz: 43a65bfab6574ff8f1b8d324da2d305baa99a871971814033fb232c60deaa7e2ed8348da24419e6f73ad13271c0eafcbaefde0598a1ed5cbff5bc8da0fdf3991
7
- data.tar.gz: 388a9c9628a15f9ac638a592cdbd527db9ab2d7bbb2e8d2492a8e987ea2744e3663e7dbaff18f80d780e199f5a8019d008e05843223cac8649fa9d8e33827cb2
6
+ metadata.gz: 501ceb508242a5d63bb0a1959661238ac070e7efeaad445a96921e465abfae1c8bb8b0adc3aa1b5832468a852aca6ed70dff913d7167a736b77628ee54d43d4b
7
+ data.tar.gz: 37b6c3daa6143709ffead9bb0a63320d71616520e9466f468f0ee2ff6f17185bf40b0fb93516f203183b46058af11df53ebc67ee84cb08755aad192d4e702f8d
data/CHANGELOG.md CHANGED
@@ -1,8 +1,24 @@
1
+ ## Rails 6.1.7.1 (January 17, 2023) ##
2
+
3
+ * No changes.
4
+
5
+
6
+ ## Rails 6.1.7 (September 09, 2022) ##
7
+
8
+ * Respect Active Record's primary_key_type in Active Storage migrations. Backported from 7.0.
9
+
10
+ *fatkodima*
11
+
1
12
  ## Rails 6.1.6.1 (July 12, 2022) ##
2
13
 
3
14
  * No changes.
4
15
 
5
16
 
17
+ ## Rails 6.1.6 (May 09, 2022) ##
18
+
19
+ * No changes.
20
+
21
+
6
22
  ## Rails 6.1.5.1 (April 26, 2022) ##
7
23
 
8
24
  * No changes.
@@ -1,6 +1,9 @@
1
1
  class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
2
2
  def change
3
- create_table :active_storage_blobs do |t|
3
+ # Use Active Record's configured type for primary and foreign keys
4
+ primary_key_type, foreign_key_type = primary_and_foreign_key_types
5
+
6
+ create_table :active_storage_blobs, id: primary_key_type do |t|
4
7
  t.string :key, null: false
5
8
  t.string :filename, null: false
6
9
  t.string :content_type
@@ -13,10 +16,10 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
13
16
  t.index [ :key ], unique: true
14
17
  end
15
18
 
16
- create_table :active_storage_attachments do |t|
19
+ create_table :active_storage_attachments, id: primary_key_type do |t|
17
20
  t.string :name, null: false
18
- t.references :record, null: false, polymorphic: true, index: false
19
- t.references :blob, null: false
21
+ t.references :record, null: false, polymorphic: true, index: false, type: foreign_key_type
22
+ t.references :blob, null: false, type: foreign_key_type
20
23
 
21
24
  t.datetime :created_at, null: false
22
25
 
@@ -24,12 +27,21 @@ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
24
27
  t.foreign_key :active_storage_blobs, column: :blob_id
25
28
  end
26
29
 
27
- create_table :active_storage_variant_records do |t|
28
- t.belongs_to :blob, null: false, index: false
30
+ create_table :active_storage_variant_records, id: primary_key_type do |t|
31
+ t.belongs_to :blob, null: false, index: false, type: foreign_key_type
29
32
  t.string :variation_digest, null: false
30
33
 
31
34
  t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
32
35
  t.foreign_key :active_storage_blobs, column: :blob_id
33
36
  end
34
37
  end
38
+
39
+ private
40
+ def primary_and_foreign_key_types
41
+ config = Rails.configuration.generators
42
+ setting = config.options[config.orm][:primary_key_type]
43
+ primary_key_type = setting || :primary_key
44
+ foreign_key_type = setting || :bigint
45
+ [primary_key_type, foreign_key_type]
46
+ end
35
47
  end
@@ -1,5 +1,7 @@
1
1
  class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
2
2
  def up
3
+ return unless table_exists?(:active_storage_blobs)
4
+
3
5
  unless column_exists?(:active_storage_blobs, :service_name)
4
6
  add_column :active_storage_blobs, :service_name, :string
5
7
 
@@ -12,6 +14,8 @@ class AddServiceNameToActiveStorageBlobs < ActiveRecord::Migration[6.0]
12
14
  end
13
15
 
14
16
  def down
17
+ return unless table_exists?(:active_storage_blobs)
18
+
15
19
  remove_column :active_storage_blobs, :service_name
16
20
  end
17
21
  end
@@ -1,11 +1,26 @@
1
1
  class CreateActiveStorageVariantRecords < ActiveRecord::Migration[6.0]
2
2
  def change
3
- create_table :active_storage_variant_records do |t|
4
- t.belongs_to :blob, null: false, index: false
3
+ return unless table_exists?(:active_storage_blobs)
4
+
5
+ # Use Active Record's configured type for primary key
6
+ create_table :active_storage_variant_records, id: primary_key_type, if_not_exists: true do |t|
7
+ t.belongs_to :blob, null: false, index: false, type: blobs_primary_key_type
5
8
  t.string :variation_digest, null: false
6
9
 
7
10
  t.index %i[ blob_id variation_digest ], name: "index_active_storage_variant_records_uniqueness", unique: true
8
11
  t.foreign_key :active_storage_blobs, column: :blob_id
9
12
  end
10
13
  end
14
+
15
+ private
16
+ def primary_key_type
17
+ config = Rails.configuration.generators
18
+ config.options[config.orm][:primary_key_type] || :primary_key
19
+ end
20
+
21
+ def blobs_primary_key_type
22
+ pkey_name = connection.primary_key(:active_storage_blobs)
23
+ pkey_column = connection.columns(:active_storage_blobs).find { |c| c.name == pkey_name }
24
+ pkey_column.bigint? ? :bigint : pkey_column.type
25
+ end
11
26
  end
@@ -9,7 +9,7 @@ module ActiveStorage
9
9
  module VERSION
10
10
  MAJOR = 6
11
11
  MINOR = 1
12
- TINY = 6
12
+ TINY = 7
13
13
  PRE = "1"
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activestorage
3
3
  version: !ruby/object:Gem::Version
4
- version: 6.1.6.1
4
+ version: 6.1.7.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-12 00:00:00.000000000 Z
11
+ date: 2023-01-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -16,56 +16,56 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 6.1.6.1
19
+ version: 6.1.7.1
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 6.1.6.1
26
+ version: 6.1.7.1
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: actionpack
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - '='
32
32
  - !ruby/object:Gem::Version
33
- version: 6.1.6.1
33
+ version: 6.1.7.1
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - '='
39
39
  - !ruby/object:Gem::Version
40
- version: 6.1.6.1
40
+ version: 6.1.7.1
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: activejob
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 6.1.6.1
47
+ version: 6.1.7.1
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 6.1.6.1
54
+ version: 6.1.7.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: activerecord
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 6.1.6.1
61
+ version: 6.1.7.1
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 6.1.6.1
68
+ version: 6.1.7.1
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: marcel
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -188,10 +188,10 @@ licenses:
188
188
  - MIT
189
189
  metadata:
190
190
  bug_tracker_uri: https://github.com/rails/rails/issues
191
- changelog_uri: https://github.com/rails/rails/blob/v6.1.6.1/activestorage/CHANGELOG.md
192
- documentation_uri: https://api.rubyonrails.org/v6.1.6.1/
191
+ changelog_uri: https://github.com/rails/rails/blob/v6.1.7.1/activestorage/CHANGELOG.md
192
+ documentation_uri: https://api.rubyonrails.org/v6.1.7.1/
193
193
  mailing_list_uri: https://discuss.rubyonrails.org/c/rubyonrails-talk
194
- source_code_uri: https://github.com/rails/rails/tree/v6.1.6.1/activestorage
194
+ source_code_uri: https://github.com/rails/rails/tree/v6.1.7.1/activestorage
195
195
  rubygems_mfa_required: 'true'
196
196
  post_install_message:
197
197
  rdoc_options: []
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  - !ruby/object:Gem::Version
209
209
  version: '0'
210
210
  requirements: []
211
- rubygems_version: 3.3.3
211
+ rubygems_version: 3.4.3
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Local and cloud file storage framework.