Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion linter/src/rules/adding_field_with_default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ pub fn adding_field_with_default(
.filter(|x| !x.is_empty())
.collect();

// println!("{:#?}", non_volatile_funcs);
for raw_stmt in tree {
match &raw_stmt.stmt {
Stmt::AlterTableStmt(stmt) => {
Expand Down
13 changes: 0 additions & 13 deletions linter/src/rules/ban_char_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,4 @@ COMMIT;
"#;
assert_debug_snapshot!(lint_sql(sql));
}
#[test]
fn regression_with_indexing_2() {
let sql = r#"
BEGIN;
ALTER TABLE "core_recipe" ADD COLUMN "foo" integer DEFAULT 10;
ALTER TABLE "core_recipe" ADD CONSTRAINT foo_not_null
CHECK ("foo" IS NOT NULL) NOT VALID;
COMMIT;
BEGIN;

"#;
assert_debug_snapshot!(lint_sql(sql));
}
}
14 changes: 14 additions & 0 deletions linter/src/rules/constraint_missing_not_valid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,18 @@ ALTER TABLE accounts VALIDATE CONSTRAINT positive_balance;

assert_debug_snapshot!(lint_sql(ok_sql));
}

#[test]
fn regression_with_indexing_2() {
let sql = r#"
BEGIN;
ALTER TABLE "core_recipe" ADD COLUMN "foo" integer DEFAULT 10;
ALTER TABLE "core_recipe" ADD CONSTRAINT foo_not_null
CHECK ("foo" IS NOT NULL) NOT VALID;
COMMIT;
BEGIN;

"#;
assert_debug_snapshot!(lint_sql(sql));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
source: linter/src/rules/constraint_missing_not_valid.rs
expression: lint_sql(sql)
---
[]
Loading