Skip to content

docs: convert newlines to spaces in advanced example#36

Merged
sbdchd merged 1 commit intomainfrom
steved-fix-advanced-docs
Feb 23, 2026
Merged

docs: convert newlines to spaces in advanced example#36
sbdchd merged 1 commit intomainfrom
steved-fix-advanced-docs

Conversation

@sbdchd
Copy link
Owner

@sbdchd sbdchd commented Feb 23, 2026

fixes #35

@github-actions
Copy link

Squawk Report

🚒 8 violations across 1 file(s)


example.sql

BEGIN;
--
-- Create model Bar
--
CREATE TABLE "core_bar"(
    "id" serial NOT NULL PRIMARY KEY,
    "alpha" varchar(100) NOT NULL
);
CREATE INDEX "field_name_idx" ON "table_name"("field_name");
ALTER TABLE table_name
    ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
COMMIT;

🚒 Rule Violations (8)

warning[prefer-bigint-over-int]: Using 32-bit integer fields can result in hitting the max `int` limit.
  ╭▸ example.sql:6:10
  │
6 │     "id" serial NOT NULL PRIMARY KEY,
  │          ━━━━━━
  │
  ├ help: Use 64-bit integer values instead to prevent hitting this limit.
  ╭╴
6 │     "id" bigserial NOT NULL PRIMARY KEY,
  ╰╴         +++
warning[prefer-identity]: Serial types make schema, dependency, and permission management difficult.
  ╭▸ example.sql:6:10
  │
6 │     "id" serial NOT NULL PRIMARY KEY,
  │          ━━━━━━
  │
  ├ help: Use an `IDENTITY` column instead.
  ╭╴
6 -     "id" serial NOT NULL PRIMARY KEY,
6 +     "id" integer generated by default as identity NOT NULL PRIMARY KEY,
  ╰╴
warning[prefer-text-field]: Changing the size of a `varchar` field requires an `ACCESS EXCLUSIVE` lock, that will prevent all reads and writes to the table.
  ╭▸ example.sql:7:13
  │
7 │     "alpha" varchar(100) NOT NULL
  │             ━━━━━━━━━━━━
  │
  ├ help: Use a `TEXT` field with a `CHECK` constraint.
  ╭╴
7 -     "alpha" varchar(100) NOT NULL
7 +     "alpha" text NOT NULL
  ╰╴
warning[require-concurrent-index-creation]: During normal index creation, table updates are blocked, but reads are still allowed.
  ╭▸ example.sql:9:1
  │
9 │ CREATE INDEX "field_name_idx" ON "table_name"("field_name");
  │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  │
  ├ help: Use `concurrently` to avoid blocking writes.
  ╭╴
9 │ CREATE INDEX concurrently "field_name_idx" ON "table_name"("field_name");
  ╰╴             ++++++++++++
warning[require-timeout-settings]: Missing `set lock_timeout` before potentially slow operations
  ╭▸ example.sql:9:1
  │
9 │ CREATE INDEX "field_name_idx" ON "table_name"("field_name");
  │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  │
  ├ help: Configure a `lock_timeout` before this statement.
  ╭╴
1 + set lock_timeout = '1s';
  ╰╴
warning[require-timeout-settings]: Missing `set statement_timeout` before potentially slow operations
  ╭▸ example.sql:9:1
  │
9 │ CREATE INDEX "field_name_idx" ON "table_name"("field_name");
  │ ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
  │
  ├ help: Configure a `statement_timeout` before this statement
  ╭╴
1 + set statement_timeout = '5s';
  ╰╴
warning[constraint-missing-not-valid]: By default new constraints require a table scan and block writes to the table while that scan occurs.
   ╭▸ example.sql:11:5
   │
11 │     ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
   │     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   │
   ╰ help: Use `NOT VALID` with a later `VALIDATE CONSTRAINT` call.
warning[disallowed-unique-constraint]: Adding a `UNIQUE` constraint requires an `ACCESS EXCLUSIVE` lock which blocks reads and writes to the table while the index is built.
   ╭▸ example.sql:11:9
   │
11 │     ADD CONSTRAINT field_name_constraint UNIQUE (field_name);
   │         ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   │
   ╰ help: Create an index `CONCURRENTLY` and create the constraint using the index.

📚 More info on rules

⚡️ Powered by Squawk (2.41.0), a linter for PostgreSQL, focused on migrations

@sbdchd sbdchd merged commit 0f4be87 into main Feb 23, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

readme example doesnt work with multiple modified migrations

1 participant