-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve unique constraint check (#337)
fixes #336
- Loading branch information
Showing
5 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...__rules__disallow_unique_constraint__test_rules__unique_constraint_inline_add_column.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
source: linter/src/rules/disallow_unique_constraint.rs | ||
expression: lint_sql(sql) | ||
--- | ||
[ | ||
RuleViolation { | ||
kind: DisallowedUniqueConstraint, | ||
span: Span { | ||
start: 0, | ||
len: Some( | ||
69, | ||
), | ||
}, | ||
messages: [ | ||
Note( | ||
"Adding a UNIQUE constraint requires an ACCESS EXCLUSIVE lock which blocks reads.", | ||
), | ||
Help( | ||
"Create an index CONCURRENTLY and create the constraint using the index.", | ||
), | ||
], | ||
}, | ||
] |
23 changes: 23 additions & 0 deletions
23
...__disallow_unique_constraint__test_rules__unique_constraint_inline_add_column_unique.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
--- | ||
source: linter/src/rules/disallow_unique_constraint.rs | ||
expression: lint_sql(sql) | ||
--- | ||
[ | ||
RuleViolation { | ||
kind: DisallowedUniqueConstraint, | ||
span: Span { | ||
start: 0, | ||
len: Some( | ||
43, | ||
), | ||
}, | ||
messages: [ | ||
Note( | ||
"Adding a UNIQUE constraint requires an ACCESS EXCLUSIVE lock which blocks reads.", | ||
), | ||
Help( | ||
"Create an index CONCURRENTLY and create the constraint using the index.", | ||
), | ||
], | ||
}, | ||
] |