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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e808594761335f44f706defa7a34f25b62ac9767f37f1560a99e2969d72dc907
|
4
|
+
data.tar.gz: ef1c7bfae6d439663a32ae59e6c91ef4f82a7dff0b8d226c3d915f9a2c40c903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cc4ac28226a71c9bf24bd3960c342ec9d80af53e06ad17001bb4a92b7e02459f5b261c14cb6cc55c07bcb432295c26eb44f0a5bd55da0d7d8a70d727ab932ab1
|
7
|
+
data.tar.gz: 3bc237063b2b339e77fd11cddbcb0b0a66f64e32aac3ff5e14365d3eea231431dd08f2db945159eb2f35ec9222763c189dd95366bd61a3e325bced158a57b97a
|
@@ -1,14 +1,22 @@
|
|
1
1
|
class CreateFeatureSubscriptions < ActiveRecord::Migration[8.0]
|
2
|
-
def
|
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,
|
11
|
-
|
12
|
-
unique: true,
|
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
|
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
|
data/lib/pin_flags/version.rb
CHANGED