Add a "compact" command

Đang mở
#105 5 bình luận 4 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
postgresql, typescript
Lĩnh vực
cli, databases

Hướng nghiên cứu

Bắt đầu bằng cách xác định entry point của lệnh CLI graphile-migrate và phần code quản lý shadow database cũng như committed/ và migrations. Xem xét cách pg_dump -c có thể tạo ra một migration thay thế duy nhất; công việc được xem là hoàn tất khi committed/ được cô đọng thành một migration, vẫn giữ nguyên schema của database và xác thực hành vi bằng các test.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement
Feature description

Add a command,

graphile-migrate compact

which compresses all of the migrations in committed/ to one migration. I think this can be accomplished by running all the committed migrations on the shadow database and then dumping the output via pg_dump -c, where -c is the "clean" flag that includes statements to drop objects.

Motivating example

Over time, you can accumulate a large number of committed migrations. This is mostly a non-issue, but when it has become an issue is when I'm redefining a function for the more than 2nd time.

I'll search my code for CREATE OR REPLACE FUNCTION my_func_name to find the latest definition, and occasionally I'll find an older version to redefine and accidentally re-introduce a change incidental to my intended change.

Checking a dump mostly solves this, but it would be nice not to encounter it in the first place and to keep the committed migrations clean.

I'm also curious to see if other people have potential uses for this - not 100% committed to it being necessary / good.

Supporting development

I [tick all that apply]:

  • am interested in building this feature myself
  • am interested in collaborating on building this feature
  • am willing to help testing this feature before it's released
  • am willing to write a test-driven test suite for this feature (before it exists)
  • am a Graphile sponsor ❤️
  • have an active support or consultancy contract with Graphile
Ngôn ngữ chính
TypeScript
Star
836
Fork
71
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của graphile/migrate

Tất cả issue của graphile/migrate

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.