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

Request: Option to examine and migrate/diff content of specific tables (ie: for lookup/enum style tables) #3218

Open
veqryn opened this issue Nov 13, 2024 · 0 comments

Comments

@veqryn
Copy link

veqryn commented Nov 13, 2024

Rather than use enums, we choose to use lookup tables.

Example:

CREATE TABLE "status" (
    id   SMALLSERIAL NOT NULL PRIMARY KEY,
    name TEXT        NOT NULL UNIQUE
);

INSERT INTO "status" (id, name) VALUES (1, 'OPEN'), (2, 'CLOSED');

It would great if I could specify some tables that I would like the contents included in the diff and the created versioned migration file.
Something like:
atlas migrate diff {{NAME}} --dir "file://{{PROJECT_PATH}}/migrations" --to "file://{{PROJECT_PATH}}/desired_end_state_schema.sql" --dev-url "docker://postgres/16.4/dev?search_path=public" --examine-content-tables "status,severity,etc"

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

No branches or pull requests

1 participant