Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

[Feature Request] Migration Diff Validation Against schema.zmodel for CI Pipeline

Đang mở
#2,729 0 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
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
typescript
Lĩnh vực
ci-cd, databases

Hướng nghiên cứu

The request is a zen migrate diff command that fails CI when prisma/migrations no longer matches the schema generated from schema.zmodel. Start by finding how the existing zen generate, zen db push and zen migrate deploy commands are wired in the CLI, and how zmodel is turned into prisma/schema.prisma. The suggested route shells out to prisma migrate diff --exit-code --from-migrations ... --to-schema-datamodel ... with a shadow DB URL. Done means CI exits non-zero when a migration is missing.

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

Mô tả

Is your feature request related to a problem? Please describe.
Here's what often happens:

  • I changed schema.zmodel
  • I ran zen generate
  • I ran zen db push for dev environment DB
  • No TypeScript errors
  • I pushed to production.
  • CI checked migration status is OK.

Later, users encounter errors, because I forgot to create the migration for the production DB.

The problem is that the developers are often forget to create the migration, so zen migrate deploy in CI would result in No pending migrations to apply.. Forgetting to create the migration is what I want to prevent, since in dev/local we could just do zen db push.

Describe the solution you'd like
A simple command for CI process to check the migrations consistency with the schema, like:

zen migrate diff

Describe alternatives you've considered
Hacky solution (not tested yet), idea from AI and others:

  • Generate the prisma schema version from zmodel.
  • Check the schema consistency by running prisma migrate diff --exit-code --from-migrations prisma/migrations --to-schema-datamodel prisma/schema.prisma --shadow-database-url "$SHADOW_DATABASE_URL"

Additional context
Relevant posts:

Ngôn ngữ chính
TypeScript
Star
2.9k
Fork
157
Merge trung bình
11 giờ 42 phút
Pull request đã merge (30 ngày)
20

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

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

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 zenstackhq/zenstack

Tất cả issue của zenstackhq/zenstack

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.