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

`public.packages` view should take `app.package_upgrades` into account as well for its latest_version column.

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

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

Đánh giá

Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
postgresql, sql
Lĩnh vực
databases

Hướng nghiên cứu

Xác định định nghĩa của view public.packages và kiểm tra cách app.package_versions và app.package_upgrades cung cấp các giá trị phiên bản. Tái hiện vấn đề bằng my_ext--1.0.0.sql và my_ext--1.0.0--2.0.0.sql, sau đó xác minh rằng latest_version báo cáo 2.0.0 thay vì 1.0.0.

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

Mô tả

bug

Currently the public.packages view is defined like this:

create or replace view public.packages as
    select
        pa.id,
        pa.package_name,
        pa.handle,
        pa.partial_name,
        newest_ver.version as latest_version,
        newest_ver.description_md,
        pa.control_description,
        pa.control_requires,
        pa.created_at,
        pa.default_version
    from
        app.packages pa,
        lateral (
            select *
            from app.package_versions pv
            where pv.package_id = pa.id
            order by pv.version_struct desc
            limit 1
        ) newest_ver;

Notice how in the lateral clause only app.package_versions are read but there's no app.package_upgrades. This results in the latest version being returned as less if there is one base version with an upgrade.

To reproduce publish an extension with my_ext--1.0.0.sql and my_ext--1.0.0--2.0.0.sql files and notice how the latest version reported is 1.0.0.

To fix, the view should take the maximum version from among the app.package_versions's version column and app.package_upgrade's to_version column.

Ngôn ngữ chính
TypeScript
Star
442
Fork
31
Merge trung bình
1 giờ 19 phút
Pull request đã merge (30 ngày)
9

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 supabase/dbdev

Tất cả issue của supabase/dbdev

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.