select pfl.category_image from product_full_list pfl 


UPDATE product_full_list 
SET category_image = REPLACE(category_image, 
    'https://natpyffafbqetnbeoctm.supabase.co/storage/v1/object/', 
    'https://alb.datafyapp.co.za/storage/v1/object/');
    
   
   
   
   select s.channel_image from store s  where s.channel_image is not null
   
   
   UPDATE store 
SET channel_image = REPLACE(channel_image, 
    'https://natpyffafbqetnbeoctm.supabase.co/storage/v1/object/', 
    'https://alb.datafyapp.co.za/storage/v1/object/');
    
   
   SELECT *
INTO store_product_backup_20241128
FROM store_product;

CREATE TABLE store_product (
    store_id INT NOT NULL,
    product_id INT NOT NULL,
    PRIMARY KEY (store_id, product_id),
    FOREIGN KEY (store_id) REFERENCES store(id),
    FOREIGN KEY (product_id) REFERENCES product(id)
);

INSERT INTO store_product (store_id, product_id)
SELECT s.id AS store_id, p.id AS product_id
FROM temp_products tp
JOIN store s ON tp.channel = s.channel
JOIN product p ON tp.category = p.category
                AND tp.brand = p.brand
                AND tp.product = p.product
                AND tp.variant = p.variant
                AND tp.size = p.size
ON CONFLICT (store_id, product_id) DO NOTHING;