database_consistency 1.7.2 → 1.7.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/database_consistency +1 -1
- 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: b620d27a76af3af281a6d433f5d8383ad7b9ba33811785b55a80d33bd6fb8ce6
|
4
|
+
data.tar.gz: 378a82e286fea3e482c07e30aa02900441f47e44f7a4402b19ed7c0a6edbf6f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c756fa1d604909c62a56c51eef6d3f5140debcd5edff683dea4e5fd9f7e1f1ca421d984912b8efb5c7eacc1056bbc87fb1c5a084dda0b4a8c808e32c8df7398d
|
7
|
+
data.tar.gz: 11d4f560939e6e82f30cab8a479dfbd14e34b80ec67d62f7cc43788466bf7549d3c6841b0367745b257012975f6a89a32c7e3972ed4aff9ef47a4c260ca8bd8b
|
data/bin/database_consistency
CHANGED
@@ -7,7 +7,7 @@ default_config = DatabaseConsistency::Configuration::DEFAULT_PATH
|
|
7
7
|
if ARGV.include?('install')
|
8
8
|
require 'pathname'
|
9
9
|
|
10
|
-
file_exists = File.
|
10
|
+
file_exists = File.exist?(default_config)
|
11
11
|
rules = Pathname.new(__FILE__).dirname.join('..', 'lib', 'database_consistency', 'templates', 'rails_defaults.yml').read
|
12
12
|
if file_exists && File.foreach(default_config).grep(Regexp.new(rules.lines.first.chomp)).any?
|
13
13
|
puts "#{default_config} is already present"
|
@@ -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.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Evgeniy Demin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|