import psycopg2
conn = psycopg2.connect("postgresql://supabase_admin:HzWrn2rMMxUYWO6OT5X0PScIVEvSjQMup9YSLIrkPQ@172.18.0.5:5432/sneakerpicks")
cur = conn.cursor()

# Check feed_url column type
cur.execute("SELECT data_type, character_maximum_length FROM information_schema.columns WHERE table_name='feeds' AND column_name='feed_url'")
print(f"feed_url column: {cur.fetchone()}")

# Check if the Awin URLs are just too long
urls = {
    "adidas": "https://productdata.awin.com/datafeed/download/apikey/489bdc79c6362be4f7d60e6b2506a2de/fid/92135/format/csv/language/nl/delimiter/%2C/compression/gzip/columns/data_feed_id%2Cmerchant_id%2Cmerchant_name%2Caw_product_id%2Caw_deep_link%2Caw_image_url%2Caw_thumb_url%2Ccategory_id%2Ccategory_name%2Cbrand_id%2Cbrand_name%2Cmerchant_product_id%2Cmerchant_category%2Cupc%2Cean%2Cmpn%2Cproduct_name%2Cdescription%2Cspecifications%2Cmerchant_deep_link%2Cmerchant_image_url%2Cdelivery_time%2Ccurrency%2Csearch_price%2Cdelivery_cost%2Cin_stock%2Cstock_quantity%2Ccolour%2Ccustom_1%2Ccustom_2%2Ccustom_3%2Ccustom_4%2Ccustom_5%2CFashion%3Asuitable_for%2CFashion%3Asize%2Crating%2Calternate_image%2Cbase_price%2Cproduct_price_old%2Calternate_image_two%2Calternate_image_three%2Ccustom_6%2Calternate_image_four/",
}
for name, url in urls.items():
    print(f"{name} URL length: {len(url)}")

conn.close()
