-
-
Notifications
You must be signed in to change notification settings - Fork 1
Fix in LastStatementId #13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
c53d947
780e052
b565228
0abf61b
3480c54
0e2543a
21747a3
9fc3993
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| alter table account | ||
| drop column laststatementid; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ALTER TABLE statement | ||
| DROP CONSTRAINT statement_chk_value_nonnegative; | ||
|
|
||
| ALTER TABLE account | ||
| DROP CONSTRAINT account_chk_value_nonnegative; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| alter table account | ||
| add laststatementid int null; | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| ALTER TABLE statement | ||
| ADD CONSTRAINT statement_chk_value_nonnegative | ||
| CHECK (netbalance >= 0); | ||
|
Comment on lines
+2
to
+3
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Misleading constraint name for non-negative check
Tell me moreWhat is the issue?The constraint name 'statement_chk_value_nonnegative' suggests it's checking for non-negative values, but the CHECK condition allows zero values (>= 0) rather than strictly positive values (> 0). Why this mattersThis naming inconsistency could mislead future developers about the actual constraint behavior, potentially causing incorrect assumptions when writing application logic or additional constraints. Suggested change ∙ Feature PreviewEither rename the constraint to reflect that zero is allowed (e.g., 'statement_chk_netbalance_not_negative') or change the condition to ALTER TABLE statement
ADD CONSTRAINT statement_chk_netbalance_not_negative
CHECK (netbalance >= 0);Provide feedback to improve future suggestions💬 Looking for more details? Reply to this comment to chat with Korbit. |
||
|
|
||
| ALTER TABLE account | ||
| ADD CONSTRAINT account_chk_value_nonnegative | ||
| CHECK (netbalance >= 0); | ||
|
Comment on lines
+6
to
+7
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Misleading constraint name for non-negative check
Tell me moreWhat is the issue?The constraint name 'account_chk_value_nonnegative' suggests it's checking for non-negative values, but the CHECK condition allows zero values (>= 0) rather than strictly positive values (> 0). Why this mattersThis naming inconsistency could mislead future developers about the actual constraint behavior, potentially causing incorrect assumptions when writing application logic or additional constraints. Suggested change ∙ Feature PreviewEither rename the constraint to reflect that zero is allowed (e.g., 'account_chk_netbalance_not_negative') or change the condition to ALTER TABLE account
ADD CONSTRAINT account_chk_netbalance_not_negative
CHECK (netbalance >= 0);Provide feedback to improve future suggestions💬 Looking for more details? Reply to this comment to chat with Korbit. |
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imprecise constraint naming
Tell me more
What is the issue?
The constraint name suggests 'nonnegative' but the logic checks for 'greater than or equal to zero', which could be more explicitly stated in the constraint name.
Why this matters
When other developers encounter this code, they need to check the actual constraint logic to confirm what 'nonnegative' means. A more precise name would make the behavior immediately clear.
Suggested change ∙ Feature Preview
Provide feedback to improve future suggestions
💬 Looking for more details? Reply to this comment to chat with Korbit.