pin_flags 0.1.0 → 0.1.1

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: 5b94771e7b5477d6cf819a8358ee02be48164415e98dfdad1d9d22130b681466
4
- data.tar.gz: 374c05f5cc5ef80688a4242e540691f96ee87eaa7583ab43396298c035685068
3
+ metadata.gz: e808594761335f44f706defa7a34f25b62ac9767f37f1560a99e2969d72dc907
4
+ data.tar.gz: ef1c7bfae6d439663a32ae59e6c91ef4f82a7dff0b8d226c3d915f9a2c40c903
5
5
  SHA512:
6
- metadata.gz: 1d67b77676113622a250ef2d152f8964f6e2493b45bed8ed64105dda32ac46ccfbcdbd51acb49b342ecfbc035f160a50f4f4b2ad2930db1f598c0cdd653fb812
7
- data.tar.gz: 92ee80b418db9cba2c865ce118b4817ddd3a8e858dfd89de8f9beb2c37ca5114a0fc3df923dbd24ef33aa8ee03503bb9650c2c3700757453176fc758f5a6c634
6
+ metadata.gz: cc4ac28226a71c9bf24bd3960c342ec9d80af53e06ad17001bb4a92b7e02459f5b261c14cb6cc55c07bcb432295c26eb44f0a5bd55da0d7d8a70d727ab932ab1
7
+ data.tar.gz: 3bc237063b2b339e77fd11cddbcb0b0a66f64e32aac3ff5e14365d3eea231431dd08f2db945159eb2f35ec9222763c189dd95366bd61a3e325bced158a57b97a
@@ -1,14 +1,22 @@
1
1
  class CreateFeatureSubscriptions < ActiveRecord::Migration[8.0]
2
- def change
2
+ def up
3
3
  create_table :pin_flags_feature_subscriptions do |t|
4
4
  t.references :feature_tag, null: false, foreign_key: { to_table: :pin_flags_feature_tags }
5
- t.references :feature_taggable, polymorphic: true, null: false
5
+ t.references :feature_taggable, polymorphic: true, null: false, index: false
6
6
 
7
7
  t.timestamps
8
8
  end
9
9
 
10
- add_index :pin_flags_feature_subscriptions, [ :feature_taggable_type, :feature_taggable_id ]
11
- add_index :pin_flags_feature_subscriptions, [ :feature_tag_id, :feature_taggable_type, :feature_taggable_id ],
12
- unique: true, name: "index_feature_subscriptions_unique"
10
+ add_index :pin_flags_feature_subscriptions,
11
+ %i[feature_tag_id feature_taggable_type feature_taggable_id],
12
+ unique: true,
13
+ name: "idx_pf_subs_on_tag_and_taggable"
14
+ end
15
+
16
+ def down
17
+ if table_exists?(:pin_flags_feature_subscriptions)
18
+ remove_index :pin_flags_feature_subscriptions, name: "idx_pf_subs_on_tag_and_taggable" if index_exists?(:pin_flags_feature_subscriptions, name: "idx_pf_subs_on_tag_and_taggable")
19
+ drop_table :pin_flags_feature_subscriptions
20
+ end
13
21
  end
14
22
  end
@@ -1,5 +1,5 @@
1
1
  class CreateFeatureTag < ActiveRecord::Migration[8.0]
2
- def change
2
+ def up
3
3
  create_table :pin_flags_feature_tags do |t|
4
4
  t.string :name, null: false
5
5
  t.boolean :enabled, default: true, null: false
@@ -9,4 +9,11 @@ class CreateFeatureTag < ActiveRecord::Migration[8.0]
9
9
 
10
10
  add_index :pin_flags_feature_tags, :name, unique: true
11
11
  end
12
+
13
+ def down
14
+ if table_exists?(:pin_flags_feature_tags)
15
+ remove_index :pin_flags_feature_tags, :name if index_exists?(:pin_flags_feature_tags, :name)
16
+ drop_table :pin_flags_feature_tags
17
+ end
18
+ end
12
19
  end
@@ -1,3 +1,3 @@
1
1
  module PinFlags
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pin_flags
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Demetrious Wilson