fix: rm unique constraint on profile photo link

DESCRIPTION
    If user hasn't configured a profile photo on their forge instance,
    it would point to the default photo of the forge instance, which
    might be the same for all users without a profile photo on that
    forge instance.
This commit is contained in:
Aravinth Manivannan 2022-05-18 19:57:48 +05:30
parent 9cf1d9df46
commit 8ad466dbc8
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
3 changed files with 1 additions and 7 deletions

View file

@ -44,10 +44,6 @@ pub enum DBError {
#[error("User HTML link is already taken")]
DuplicateUserLink,
/// User profile photo link Type is already taken
#[error("User profile photo link is already taken")]
DuplicateProfilePhotoLink,
/// Topic is already taken
#[error("Topic is already taken")]
DuplicateTopic,

View file

@ -24,7 +24,7 @@ CREATE TABLE IF NOT EXISTS starchart_users (
hostname_id INTEGER NOT NULL REFERENCES starchart_forges(ID) ON DELETE CASCADE,
username TEXT NOT NULL,
html_url TEXT NOT NULL UNIQUE,
profile_photo_html_url TEXT DEFAULT NULL UNIQUE,
profile_photo_html_url TEXT DEFAULT NULL,
added_on INTEGER NOT NULL,
last_crawl_on INTEGER NOT NULL,
ID INTEGER PRIMARY KEY NOT NULL

View file

@ -40,8 +40,6 @@ pub fn map_register_err(e: Error) -> DBError {
DBError::DuplicateForgeType
} else if msg.contains("starchart_users.html_url") {
DBError::DuplicateUserLink
} else if msg.contains("starchart_users.profile_photo_html_url") {
DBError::DuplicateProfilePhotoLink
} else if msg.contains("starchart_project_topics.name") {
DBError::DuplicateTopic
} else if msg.contains("starchart_repositories.name") {