database_consistency 1.7.1 → 1.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/database_consistency/helper.rb +6 -6
- data/lib/database_consistency/version.rb +1 -1
- data/lib/database_consistency/writers/autofix/helpers/migration.rb +4 -0
- data/lib/database_consistency/writers/autofix/migration_base.rb +7 -1
- data/lib/database_consistency/writers/simple/null_constraint_misses_validator.rb +1 -1
- 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: 206fe7e1ee1028de91d489b10d455e21685383c654fbcfbc4d4e2547d602d3f4
|
4
|
+
data.tar.gz: ed3ec0dcdc367e7a666546c5021467d5b30e09675d10db57ef736c3ba608d967
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 254f03f91c90fc4ee1a079ecd467455be99ad3dedbe3703fb2bf3151b1b17e1d01c3b4bc7eb4db43bea685431ffde768c6c48c0e2e9754358b9157640c3e5592
|
7
|
+
data.tar.gz: 7e8a87dd238595b25a8040d5196d0c214fc61a12f933d708473445e297d87f6d06f84351245dac4588bdd6a4f69abd2c6e48c8a2bce2deef053ac6e98b61d1a3
|
@@ -6,10 +6,10 @@ module DatabaseConsistency
|
|
6
6
|
module_function
|
7
7
|
|
8
8
|
def adapter
|
9
|
-
if ActiveRecord::Base.respond_to?(:
|
10
|
-
ActiveRecord::Base.connection_config[:adapter]
|
11
|
-
else
|
9
|
+
if ActiveRecord::Base.respond_to?(:connection_db_config)
|
12
10
|
ActiveRecord::Base.connection_db_config.configuration_hash[:adapter]
|
11
|
+
else
|
12
|
+
ActiveRecord::Base.connection_config[:adapter]
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
@@ -18,10 +18,10 @@ module DatabaseConsistency
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def connection_config(klass)
|
21
|
-
if klass.respond_to?(:
|
22
|
-
klass.connection_config
|
23
|
-
else
|
21
|
+
if klass.respond_to?(:connection_db_config)
|
24
22
|
klass.connection_db_config.configuration_hash
|
23
|
+
else
|
24
|
+
klass.connection_config
|
25
25
|
end
|
26
26
|
end
|
27
27
|
|
@@ -7,7 +7,13 @@ module DatabaseConsistency
|
|
7
7
|
include Helpers::Migration
|
8
8
|
|
9
9
|
def fix!
|
10
|
-
|
10
|
+
file_path = migration_path(migration_name)
|
11
|
+
|
12
|
+
if Dir[migration_path_pattern(migration_name)].any?
|
13
|
+
p "Skipping migration #{migration_name} because it already exists"
|
14
|
+
else
|
15
|
+
File.write(file_path, migration)
|
16
|
+
end
|
11
17
|
end
|
12
18
|
|
13
19
|
def attributes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: database_consistency
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Demin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|