pronto-rails_migrations 0.10.1 → 0.10.2
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/pronto/rails_migrations.rb +8 -7
- data/pronto-rails_migrations.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eeb34528f8fdd5bf1307c0ce5f58dbcbe234a5eb9277a8944b4e5ea5035b0372
|
4
|
+
data.tar.gz: 23fbf86083977078f3761aa5036826da35fd071b0b43121d55baae77ee9c7915
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 06f66842fb383366a7a72070e2c57427698a886fada5c766d338d1253929dc575d0aa33ea5244356915e5d9272b8accc35f8a1abc7c095b9518d22434a694e0d
|
7
|
+
data.tar.gz: 6229ed6b24733ef6beb2dcf7066824c78b54ed07333dc729eda502e08caffe528675d8dee3c600f6113ffd1d72edb26b605a7ea13f2e6e1423f8a203caf11a60
|
@@ -8,7 +8,7 @@ module Pronto
|
|
8
8
|
if other_patches?
|
9
9
|
patch = migration_patches.first
|
10
10
|
messages << message(
|
11
|
-
patch
|
11
|
+
patch,
|
12
12
|
'Run migrations in a separate PR from application code changes.'
|
13
13
|
)
|
14
14
|
end
|
@@ -34,7 +34,6 @@ module Pronto
|
|
34
34
|
patch = structure_sql_patches.first
|
35
35
|
return false unless patch
|
36
36
|
|
37
|
-
path = patch.delta.new_file[:path]
|
38
37
|
structure_sql = File.read(patch.new_file_full_path)
|
39
38
|
inserts = structure_sql.split("\n").grep(/\('\d+'\)/)
|
40
39
|
unordered_inserts = (inserts.sort != inserts)
|
@@ -48,24 +47,26 @@ module Pronto
|
|
48
47
|
|
49
48
|
if unordered_inserts
|
50
49
|
messages << message(
|
51
|
-
|
50
|
+
patch,
|
52
51
|
'`schema_migrations` insert values are not ordered by timestamp.'
|
53
52
|
)
|
54
53
|
end
|
55
54
|
if bad_semicolons
|
56
55
|
messages << message(
|
57
|
-
|
56
|
+
patch,
|
58
57
|
'`schema_migrations` inserts must end with comma (`,`), ' \
|
59
58
|
'last insert must end with semicolon (`;`).'
|
60
59
|
)
|
61
60
|
end
|
62
|
-
messages << message(
|
61
|
+
messages << message(patch, '`db/structure.sql` must end with 2 empty lines.') if bad_ending
|
63
62
|
|
64
63
|
messages
|
65
64
|
end
|
66
65
|
|
67
|
-
def message(
|
68
|
-
|
66
|
+
def message(patch, text)
|
67
|
+
path = patch.delta.new_file[:path]
|
68
|
+
line = patch.added_lines.first
|
69
|
+
Message.new(path, line, :warning, text, nil, self.class)
|
69
70
|
end
|
70
71
|
|
71
72
|
def structure_sql_patches
|