bard-rake 0.18.0 → 0.18.3
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 +4 -4
- data/lib/bard/rake/db_dump_load.rb +12 -4
- data/lib/bard/rake/db_multiple_environment_sanity.rb +7 -2
- data/lib/bard/rake/version.rb +1 -1
- data/lib/generators/bard/utf8mb4_migration/templates/migration.rb.tt +1 -1
- data/lib/generators/bard/utf8mb4_migration/utf8mb4_migration_generator.rb +1 -3
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 38773c410d093bc039c0ffd18bba5cb685a386950bc79637663d236bde41f084
|
|
4
|
+
data.tar.gz: 79cecaa68b6db7e870ba3fd0abe43155ac6b9301d119d83bedced297b2cdc95b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a6acaddff47bb7c664f04c050d7d3df6b07fac32b140250f0a504ede020da0754107881597ae36edf2ede949e39a8e9176bdbda49b9ff19ce4e964dc12ea4161
|
|
7
|
+
data.tar.gz: f94310bfa99cc38d836f719a2d326276108eb748d84283912e68d7ea56a445f3f571295fa0e76613bced6fadda0b525e8c2358ad8f337b549e10772d85d79a77
|
|
@@ -17,15 +17,23 @@ if defined?(ActiveRecord)
|
|
|
17
17
|
namespace :db do
|
|
18
18
|
namespace :create do
|
|
19
19
|
task :current => :load_config do
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
if ActiveRecord::Tasks::DatabaseTasks.respond_to?(:current_config)
|
|
21
|
+
config = ActiveRecord::Tasks::DatabaseTasks.current_config
|
|
22
|
+
ActiveRecord::Tasks::DatabaseTasks.create config
|
|
23
|
+
else
|
|
24
|
+
ActiveRecord::Tasks::DatabaseTasks.create_current Rails.env
|
|
25
|
+
end
|
|
22
26
|
end
|
|
23
27
|
end
|
|
24
28
|
|
|
25
29
|
namespace :drop do
|
|
26
30
|
task :current => :load_config do
|
|
27
|
-
|
|
28
|
-
|
|
31
|
+
if ActiveRecord::Tasks::DatabaseTasks.respond_to?(:current_config)
|
|
32
|
+
config = ActiveRecord::Tasks::DatabaseTasks.current_config
|
|
33
|
+
ActiveRecord::Tasks::DatabaseTasks.drop config
|
|
34
|
+
else
|
|
35
|
+
ActiveRecord::Tasks::DatabaseTasks.drop_current Rails.env
|
|
36
|
+
end
|
|
29
37
|
end
|
|
30
38
|
end
|
|
31
39
|
end
|
|
@@ -56,8 +56,13 @@ if defined?(ActiveRecord)
|
|
|
56
56
|
|
|
57
57
|
ActiveRecord::Base.configurations.configs_for.each do |db_config|
|
|
58
58
|
env = db_config.env_name
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
if Rails.version < "7"
|
|
60
|
+
configuration = db_config.config
|
|
61
|
+
database = configuration["database"]
|
|
62
|
+
else
|
|
63
|
+
configuration = db_config.configuration_hash
|
|
64
|
+
database = configuration[:database]
|
|
65
|
+
end
|
|
61
66
|
|
|
62
67
|
next unless database
|
|
63
68
|
next unless whitelist.include?(env)
|
data/lib/bard/rake/version.rb
CHANGED
|
@@ -17,9 +17,7 @@ module Bard
|
|
|
17
17
|
|
|
18
18
|
def specify_charset_and_collation_in_database_yml
|
|
19
19
|
["config/database.yml", "config/database.sample.yml"].each do |file|
|
|
20
|
-
|
|
21
|
-
inject_into_file file, line, after: " socket: /var/run/mysqld/mysqld.sock\n"
|
|
22
|
-
end
|
|
20
|
+
inject_into_file file, " charset: utf8mb4\n", after: " socket: /var/run/mysqld/mysqld.sock\n"
|
|
23
21
|
end
|
|
24
22
|
end
|
|
25
23
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bard-rake
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.18.
|
|
4
|
+
version: 0.18.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Micah Geisel
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-03-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|