Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make data-packing toggle-able #119

Merged
merged 1 commit into from
Mar 21, 2024

Conversation

bplunkett-stripe
Copy link
Collaborator

Description

Make data-packing toggle-table. It is on by default. To disable, pass the option: -data-pack-new-tables=false

Motivation

#118

Testing

  go run ./cmd/pg-schema-diff plan  --dsn "host=localhost user=postgres password=postgres database=somedb" --schema-dir ~/stripe/temp/examplesql

################################ Generated plan ################################
1. CREATE TABLE "public"."foobar" (
        "id" integer,
        "some_other_column" character varying(255) COLLATE "pg_catalog"."default",
        "fizz" character varying(255) COLLATE "pg_catalog"."default"
);
        -- Statement Timeout: 3s

2. ALTER TABLE "public"."foobar" ADD CONSTRAINT "some_constraint" CHECK((id > 0));
        -- Statement Timeout: 3s

3. ALTER TABLE "public"."foobar" REPLICA IDENTITY FULL;
        -- Statement Timeout: 3s

4. CREATE INDEX CONCURRENTLY some_idx ON public.foobar USING btree (id);
        -- Statement Timeout: 20m0s
        -- Lock Timeout: 3s

 ~/stripe/pg-schema-diff │ bplunkett/ma…g-toggleable  go run ./cmd/pg-schema-diff plan  --dsn "host=localhost user=postgres password=postgres database=somedb" --schema-dir ~/stripe/temp/examplesql --data-pack-new-tables=false

################################ Generated plan ################################
1. CREATE TABLE "public"."foobar" (
        "some_other_column" character varying(255) COLLATE "pg_catalog"."default",
        "fizz" character varying(255) COLLATE "pg_catalog"."default",
        "id" integer
);
        -- Statement Timeout: 3s

2. ALTER TABLE "public"."foobar" ADD CONSTRAINT "some_constraint" CHECK((id > 0));
        -- Statement Timeout: 3s

3. ALTER TABLE "public"."foobar" REPLICA IDENTITY FULL;
        -- Statement Timeout: 3s

4. CREATE INDEX CONCURRENTLY some_idx ON public.foobar USING btree (id);
        -- Statement Timeout: 20m0s
        -- Lock Timeout: 3s

@bplunkett-stripe bplunkett-stripe merged commit 20140e8 into main Mar 21, 2024
6 checks passed
@bplunkett-stripe bplunkett-stripe deleted the bplunkett/make-data-packing-toggleable branch March 21, 2024 18:54
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.

2 participants