bullet_train-roles 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f41c9b86402531e17f5853d967530968368985d44a5130f011c8d6d0844691a7
|
4
|
+
data.tar.gz: 102b0571926e9a698b2654b8d54128b226e8c67ffdd10f626a18baf23b35c754
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92706fc57f271f24cdcc2a6c204bbfeb21fe79e0a0b2cedd480c8ea51c62157e93f4665fe7de98f0ad0ff8b96fc04cd6448d408415faced1936e4d68a0521583
|
7
|
+
data.tar.gz: 50c64184545ecfcdab68be3163148ae0d1ee3727f23fb415cfa741418d66b1aed71946f4e3902413d118bd22abe2e6715840d2548835f72d3d4f019412297807
|
data/README.md
CHANGED
@@ -54,7 +54,7 @@ The installer will:
|
|
54
54
|
|
55
55
|
### Limitations
|
56
56
|
|
57
|
-
The generators currently assume you're using PostgreSQL and `jsonb` will be available when generating a `role_ids` column. If you're using MySQL,
|
57
|
+
The generators currently assume you're using PostgreSQL and `jsonb` will be available when generating a `role_ids` column. If you're using MySQL, the generator will use `json` instead, although you won't be able to set a default value and you'll need to take care of this in the model.
|
58
58
|
|
59
59
|
## Usage
|
60
60
|
|
@@ -58,6 +58,11 @@ module BulletTrain
|
|
58
58
|
adapter_name
|
59
59
|
end
|
60
60
|
|
61
|
+
def db_adapter_supports_defaults?
|
62
|
+
supported_db_adapters = %w[postgresql]
|
63
|
+
supported_db_adapters.include?(db_adapter)
|
64
|
+
end
|
65
|
+
|
61
66
|
def find_json_data_type_identifier
|
62
67
|
adapter_name = db_adapter
|
63
68
|
|
@@ -119,7 +124,7 @@ module BulletTrain
|
|
119
124
|
|
120
125
|
generate "migration", "#{migration_file_name} role_ids:#{json_data_type_identifier}"
|
121
126
|
|
122
|
-
add_default_value_to_migration(migration_file_name, top_level_model_table_name)
|
127
|
+
add_default_value_to_migration(migration_file_name, top_level_model_table_name) if db_adapter_supports_defaults?
|
123
128
|
|
124
129
|
puts("Success 🎉🎉\n\n")
|
125
130
|
end
|