Ref: #104305
No functional changes. Ref: #104305
Convert the database integrity check from GORM to sqlc. No functional changes. Ref: #104305