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

Circular foreign key references

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

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
30/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
mariadb, mysql, sql
Lĩnh vực
databases

Hướng nghiên cứu

Không có tệp schema hoặc test nào được nêu. Bắt đầu bằng cách tìm các định nghĩa và tham chiếu của BLSample.blSubSampleId và DataCollection.strategySubWedgeOrigId, sau đó kiểm tra cách chúng được sử dụng tại DLS và chạy lại lệnh sqlacodegen. Được xem là hoàn tất khi mục đích và quyết định loại bỏ cả hai cột đã được ghi lại, đồng thời các thay đổi schema bị ảnh hưởng đã được thống nhất.

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

Mô tả

Attempting to generate sqlalchemy models via sqlacodegen leads to the following warning/error:

sqlacodegen mysql+pymysql://user:password@host:port/ispyb_build --noinflect > models.py
/Users/rjgildea/software/cctbx_py3/conda_base/lib/python3.8/site-packages/sqlalchemy/sql/ddl.py:1213: SAWarning: Cannot correctly sort tables; there are unresolvable cycles between tables "BLSample, BLSampleImage, BLSubSample, DataCollection, Screening, ScreeningOutput, ScreeningStrategy, ScreeningStrategySubWedge, ScreeningStrategyWedge", which is usually caused by mutually dependent foreign key constraints.  Foreign key constraints involving these tables will not be considered; this warning may raise an error in a future release.
  util.warn(

This appears to be the result of two circular foreign key references:
BLSample -> BLSubSample -> BLSampleImage -> BLSample (via BLSample.blSubSampleId)
and
DataCollection -> screeningStrategySubWedge -> ScreeningStrategyWedge -> ScreeningStrategy -> Screening -> DataCollection (via DataCollection.strategySubWedgeOrigId).

As far as I can tell, both BLSample.blSubSampleId and DataCollection.strategySubWedgeOrigId appear to be unused at DLS. I don't understand what purpose either column serves. Can these columns be removed from the table?

Ngôn ngữ chính
Shell
Star
7
Fork
13
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 DiamondLightSource/ispyb-database

Tất cả issue của DiamondLightSource/ispyb-database

Issue tương tự

Thêm issue về Shell/Bash

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.