"""SQL queries for art_relations.""" # fetch all active vendor contracts OBTAIN_ACTIVE_CONTRACTS = """ SELECT vc.id, vc.vendor_id, vc.royalty_collection_territory FROM vendor_contract vc INNER JOIN vw_active_vendor_contract vwvc ON vwvc.vendor_contract_id = vc.id WHERE vc.cont_start = CURDATE(); """ # enable performance rights feature ENABLE_FEATURE = """ DELETE FROM vendor_restricted_features WHERE vendor_id IN ({vendor_ids}) AND feature_id = 10; """ # disable performance rights feature DISABLE_FEATURE = """ INSERT IGNORE INTO vendor_restricted_features (vendor_id, feature_id, preview, last_modified_by, user_type) VALUES {vendor_values}; """ # update performance rights feature UPDATE_FEATURE = """ UPDATE vendor_restricted_features SET last_modified_by = {last_modified_by} , user_type = "{user_type}" WHERE vendor_id IN ({vendor_ids}) AND feature_id = 10; """