Skip to content

Commit 1dc9dd0

Browse files
committed
progress
1 parent 8d8011f commit 1dc9dd0

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/reference/rules/prefer-robust-stmts.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,35 @@ CREATE INDEX CONCURRENTLY users_email_idx ON users (email);
2323
```
2424

2525
```sh
26+
code-block.sql:1:1 lint/safety/preferRobustStmts ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
27+
28+
! Concurrent index creation should use IF NOT EXISTS.
29+
30+
> 1 │ CREATE INDEX CONCURRENTLY users_email_idx ON users (email);
31+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
2 │
33+
34+
i Add IF NOT EXISTS to make the migration re-runnable if it fails.
35+
36+
2637
```
2738
2839
```sql
2940
DROP INDEX CONCURRENTLY users_email_idx;
3041
```
3142
3243
```sh
44+
code-block.sql:1:1 lint/safety/preferRobustStmts ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
45+
46+
! Concurrent drop should use IF EXISTS.
47+
48+
> 1 │ DROP INDEX CONCURRENTLY users_email_idx;
49+
│ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
50+
2 │
51+
52+
i Add IF EXISTS to make the migration re-runnable if it fails.
53+
54+
3355
```
3456
3557
### Valid

0 commit comments

Comments
 (0)