Skip to content

Commit 51812dd

Browse files
committed
chore: accept good snapshots
1 parent a01a9f1 commit 51812dd

File tree

4 files changed

+53
-2
lines changed

4 files changed

+53
-2
lines changed

crates/pgt_analyser/src/lint/safety/adding_field_with_default.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
use pgt_analyse::{Rule, RuleDiagnostic, RuleSource, context::RuleContext, declare_lint_rule};
1+
use pgt_analyse::{context::RuleContext, declare_lint_rule, Rule, RuleDiagnostic, RuleSource};
22
use pgt_console::markup;
33
use pgt_diagnostics::Severity;
4-
use std::collections::HashSet;
54

65
declare_lint_rule! {
76
/// Adding a column with a DEFAULT value may lead to a table rewrite while holding an ACCESS EXCLUSIVE lock.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
source: crates/pgt_analyser/tests/rules_tests.rs
3+
expression: snapshot
4+
snapshot_kind: text
5+
---
6+
# Input
7+
```
8+
-- expect_only_lint/safety/preferIdentity
9+
alter table test add column id serial;
10+
```
11+
12+
# Diagnostics
13+
lint/safety/preferIdentity ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
14+
15+
× Prefer IDENTITY columns over SERIAL types.
16+
17+
i Column uses 'serial' type which has limitations compared to IDENTITY columns.
18+
19+
i Use 'bigint GENERATED BY DEFAULT AS IDENTITY' or 'bigint GENERATED ALWAYS AS IDENTITY' instead.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
source: crates/pgt_analyser/tests/rules_tests.rs
3+
expression: snapshot
4+
snapshot_kind: text
5+
---
6+
# Input
7+
```
8+
-- expect_only_lint/safety/preferIdentity
9+
create table users (
10+
id bigserial
11+
);
12+
```
13+
14+
# Diagnostics
15+
lint/safety/preferIdentity ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
16+
17+
× Prefer IDENTITY columns over SERIAL types.
18+
19+
i Column uses 'bigserial' type which has limitations compared to IDENTITY columns.
20+
21+
i Use 'bigint GENERATED BY DEFAULT AS IDENTITY' or 'bigint GENERATED ALWAYS AS IDENTITY' instead.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
source: crates/pgt_analyser/tests/rules_tests.rs
3+
expression: snapshot
4+
snapshot_kind: text
5+
---
6+
# Input
7+
```
8+
-- expect_no_lint/safety/preferIdentity
9+
create table users_valid (
10+
id bigint generated by default as identity primary key
11+
);
12+
```

0 commit comments

Comments
 (0)