lazy_blob_storage 2.0.0.pre.beta.7 → 2.0.0.pre.beta.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f59d945b4c54444be929225d268159520d5ceefd47cd74f432e82c2f8c05c26c
4
- data.tar.gz: c5092d1b0f3db7974116aa3d7041a75deae86e9c94b3395bd9609ebba38bd0f3
3
+ metadata.gz: 0bd41b24bf9723782e729a80453c891b7997a1a254ec3020c966420fcf971fd5
4
+ data.tar.gz: 5936757ccfb7262de3caa1d3e1b9b5910e97561286d3895769d3b9cb9f5716dc
5
5
  SHA512:
6
- metadata.gz: a3319925424b037dd4934322b021ef020004a10db8ba768c88a5bc0461e0a88e1a7f62f8d3598f668edbfdd10c7f16c2f2f09b8ffdc357c405a3842daf93c648
7
- data.tar.gz: 4536667ff095869e75fa3b9cee03c59dd78481270c2a42edd3bc0ad11a9f6634a9fb04c816ba206c309343bbdae508ada8a986249579a65aa57afbc8557cab1a
6
+ metadata.gz: 4d02e19f73babc258462411c376b78368b46e742dc0ba1f5b944f27d3d585bd21b309a6ab825b7ab75ab79e36620abbc39f62b5ffedbf957d56601962eb5c8e1
7
+ data.tar.gz: 2d6618d774f70847c975cc4eb1d58fbc75bf893d3a843928032a4672facd8de3b5f20a90c050ff0426763b4650b6c6606428fe0ea9a08786282ff7843544475f
@@ -1,11 +1,21 @@
1
1
  class CreateLazyVariants < ActiveRecord::Migration[7.0]
2
2
  def change
3
- create_table :lazy_variants do |t|
4
- t.references :lazy_attachment
5
- t.references :lazy_blob
3
+ primary_key_type, foreign_key_type = primary_and_foreign_key_types
4
+
5
+ create_table :lazy_variants, id: primary_key_type do |t|
6
+ t.references :lazy_attachment, type: foreign_key_type
7
+ t.references :lazy_blob, type: foreign_key_type
6
8
  t.string :name
7
9
  t.index :name
8
10
  t.timestamps
9
11
  end
10
12
  end
13
+
14
+ def primary_and_foreign_key_types
15
+ config = Rails.configuration.generators
16
+ setting = config.options[config.orm][:primary_key_type]
17
+ primary_key_type = setting || :primary_key
18
+ foreign_key_type = setting || :bigint
19
+ [primary_key_type, foreign_key_type]
20
+ end
11
21
  end
@@ -1,3 +1,3 @@
1
1
  module LazyBlobStorage
2
- VERSION = "2.0.0-beta.7"
2
+ VERSION = "2.0.0-beta.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazy_blob_storage
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0.pre.beta.7
4
+ version: 2.0.0.pre.beta.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Corey Smedstad
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-04-13 00:00:00.000000000 Z
11
+ date: 2023-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport