Add mix task to undo latest codegen/delete latest migration

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

Maintainer thường phản hồi trong vòng 1 ngày

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

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/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ệ
elixir, postgresql
Lĩnh vực
cli, databases

Hướng nghiên cứu

Bắt đầu bằng cách xác định mix task tạo ra các migration và phần mã chịu trách nhiệm cho các tệp migration và snapshot của bảng. Theo dõi cách migration mới nhất và các snapshot liên quan của nó được xác định, sau đó xem xét các bài kiểm thử task hiện có hoặc các bài kiểm thử tạo migration. Hoàn thành khi một task có tên ash_postgres.delete_latest_migration chỉ xóa migration mới nhất và các snapshot của nó sau khi xác nhận tên migration.

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

Mô tả

enhancement needs review

Is your feature request related to a problem? Please describe.

Codegen to generate a migration is really awesome, but sometimes you generate a migration and then you realize you missed something, so you want to delete that migration, make the change, and then generate it again. Currently that's a manual process - go find the migration, find the snapshots for all the relevant tables, delete them all, and do it again. It's pretty annoying!

Describe the solution you'd like

A task like ash_postgres.delete_latest_migration that will delete the last migration, and any snapshots that were created at the same time. No option to delete other migrations or anything like that - only the last one.

And it should probably confirm the name of the migration just to make sure!

Describe alternatives you've considered

You could just generate another migration with the added changes, but snapshot files are big and ugly and if you haven't even run the first migration, being able to undo/regenerate it seems like the smarter approach.

Ngôn ngữ chính
Elixir
Star
191
Fork
186
Merge trung bình
16 giờ 4 phút
Pull request đã merge (30 ngày)
17

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 ash-project/ash_postgres

Tất cả issue của ash-project/ash_postgres

Issue tương tự

Thêm issue về Elixir

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.