CREATE TEMP TABLE pm(o text,n text);
INSERT INTO pm VALUES('cmmuvsi5n054bxjdtiucmz33x','c85435cb04106d6611cf22176');
INSERT INTO pm VALUES('cmmuvsct904xjxjdt6agtryx9','c1c4667eed8a90806c550626c');
INSERT INTO pm VALUES('cmmuvscsu04xhxjdthm7zhjma','c9513f4b6c74c794e3cadbe2b');
INSERT INTO pm VALUES('cmmuvs8pk04tvxjdtd78bu40l','ce384f6a22194e5b239b9e835');
INSERT INTO pm VALUES('cmmuvs5io04r1xjdtinplwr48','c4942824b9901036e1a94f5d5');
INSERT INTO pm VALUES('cmmuvs8p604ttxjdtifgi5o7m','c95556cccad0f1ebf9002570d');
INSERT INTO pm VALUES('cmmuvschr04xdxjdtvdki98hk','c9b124185ce9faa6f01cba6c2');
INSERT INTO pm VALUES('cmmuvqsbp03lpxjdt7mexmow1','ca865e677abba1dccb67206a3');
INSERT INTO pm VALUES('cmmuvoj1t00wpxjdt2xwekffc','c77fbe7519691e76638f66fc1');
INSERT INTO pm VALUES('cmmuvoss20185xjdtw0rb591b','c769da8d738a9cec0577dd4bf');
INSERT INTO "Property" (id,title,description,address,price,currency,"operationType","propertyType",bedrooms,bathrooms,"parkingSpaces","totalArea","builtArea",source,"isPublished","syncStatus","clientId","createdAt","updatedAt","isExclusive",priority,condition,features,floors,latitude,longitude,municipality,neighborhood,state,"yearBuilt","zipCode","ownerName","ownerPhone") SELECT m.n,p.title,p.description,p.address,p.price,p.currency,p."operationType",p."propertyType",p.bedrooms,p.bathrooms,p."parkingSpaces",p."totalArea",p."builtArea",'manual',true,'synced','cbd75af8d8482b327e70e3004',NOW(),NOW(),p."isExclusive",p.priority,p.condition,p.features,p.floors,p.latitude,p.longitude,p.municipality,p.neighborhood,p.state,p."yearBuilt",p."zipCode",p."ownerName",p."ownerPhone" FROM "Property" p JOIN pm m ON m.o=p.id;
INSERT INTO "PropertyImage" (id,url,"order","isMain",source,"propertyId","createdAt") SELECT substr(md5(random()::text),1,25),pi.url,pi."order",pi."isMain",pi.source,m.n,NOW() FROM "PropertyImage" pi JOIN pm m ON m.o=pi."propertyId";
