mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.43k stars 291 forks source link

Odd formatting for ALTER TABLE statements #1198

Open DavidS-ovm opened 11 months ago

DavidS-ovm commented 11 months ago

Describe the bug

Formatted result:

-- Modify "apps" table
ALTER TABLE "public"."apps"
ALTER COLUMN "created_at"
SET NOT NULL,
    ALTER COLUMN "created_at"
SET DEFAULT now(),
    ALTER COLUMN "updated_at"
SET NOT NULL,
    ALTER COLUMN "updated_at"
SET DEFAULT now();

Expected behavior

-- Modify "apps" table
ALTER TABLE "public"."apps"
    ALTER COLUMN "created_at" SET NOT NULL,
    ALTER COLUMN "created_at" SET DEFAULT now(),
    ALTER COLUMN "updated_at" SET NOT NULL,
    ALTER COLUMN "updated_at" SET DEFAULT now();

or

-- Modify "apps" table
ALTER TABLE "public"."apps"
    ALTER COLUMN "created_at"
        SET NOT NULL,
    ALTER COLUMN "created_at" 
        SET DEFAULT now(),
    ALTER COLUMN "updated_at" 
        SET NOT NULL,
    ALTER COLUMN "updated_at" 
        SET DEFAULT now();

Desktop (please complete the following information):