stripe / pg-schema-diff

Go library for diffing Postgres schemas and generating SQL migrations
MIT License
270 stars 20 forks source link

Add ability to skip apply confirm prompt #134

Closed bplunkett-stripe closed 1 month ago

bplunkett-stripe commented 1 month ago

Description

Allow user to skip apply confirm prompt. I opted to not just create a --non-interative-mode flag because we probably want a separate flag for each "interactive component" and then, once we have multiple smaller flags, maybe a total toggle.

Motivation

Fixes #133

Testing

go run ./cmd/pg-schema-diff apply  --dsn "host=localhost user=postgres password=postgres database=somedb" --schema-dir ~/temp/examplesql  --skip-confirm-prompt
################################## Review plan ##################################
1. CREATE SCHEMA "some_new_schema";
        -- Statement Timeout: 3s

############################# Executing statement 1 #############################
CREATE SCHEMA "some_new_schema";
        -- Statement Timeout: 3s

Finished executing statement. Duration: 6.026083ms
################################### Complete ###################################
Schema applied successfully