business-objects-board / discourse

Migration process from phpBB2 to Discourse
0 stars 0 forks source link

Miss a space before and after the flag #4

Closed julbrs closed 4 years ago

julbrs commented 4 years ago

See here https://bobj-board.org/t/bo-4-2-sp8-incorrect-syntax-near-a-a-a-during-install/255247

image image

We want an space before and a space after the flag icon. We want a space if there is no flag

julbrs commented 4 years ago

initial import is fixed. how to update the actual import ?

We can run that


update posts set raw = replace(raw, ':afghanistan:', ' :afghanistan: '), baked_version=null where position(':afghanistan:' in raw)>0;
update posts set raw = replace(raw, ':albania:', ' :albania: '), baked_version=null where position(':albania:' in raw)>0;
update posts set raw = replace(raw, ':algeria:', ' :algeria: '), baked_version=null where position(':algeria:' in raw)>0;
update posts set raw = replace(raw, ':american_samoa:', ' :american_samoa: '), baked_version=null where position(':american_samoa:' in raw)>0;
update posts set raw = replace(raw, ':andorra:', ' :andorra: '), baked_version=null where position(':andorra:' in raw)>0;
update posts set raw = replace(raw, ':argentina:', ' :argentina: '), baked_version=null where position(':argentina:' in raw)>0;
update posts set raw = replace(raw, ':armenia:', ' :armenia: '), baked_version=null where position(':armenia:' in raw)>0;
update posts set raw = replace(raw, ':aruba:', ' :aruba: '), baked_version=null where position(':aruba:' in raw)>0;
update posts set raw = replace(raw, ':australia:', ' :australia: '), baked_version=null where position(':australia:' in raw)>0;
update posts set raw = replace(raw, ':austria:', ' :austria: '), baked_version=null where position(':austria:' in raw)>0;
update posts set raw = replace(raw, ':azerbaijan:', ' :azerbaijan: '), baked_version=null where position(':azerbaijan:' in raw)>0;
update posts set raw = replace(raw, ':bahamas:', ' :bahamas: '), baked_version=null where position(':bahamas:' in raw)>0;
update posts set raw = replace(raw, ':bahrain:', ' :bahrain: '), baked_version=null where position(':bahrain:' in raw)>0;
update posts set raw = replace(raw, ':bangladesh:', ' :bangladesh: '), baked_version=null where position(':bangladesh:' in raw)>0;
update posts set raw = replace(raw, ':barbados:', ' :barbados: '), baked_version=null where position(':barbados:' in raw)>0;
update posts set raw = replace(raw, ':belarus:', ' :belarus: '), baked_version=null where position(':belarus:' in raw)>0;
update posts set raw = replace(raw, ':belgium:', ' :belgium: '), baked_version=null where position(':belgium:' in raw)>0;
update posts set raw = replace(raw, ':botswana:', ' :botswana: '), baked_version=null where position(':botswana:' in raw)>0;
update posts set raw = replace(raw, ':brazil:', ' :brazil: '), baked_version=null where position(':brazil:' in raw)>0;
update posts set raw = replace(raw, ':bulgaria:', ' :bulgaria: '), baked_version=null where position(':bulgaria:' in raw)>0;
update posts set raw = replace(raw, ':myanmar:', ' :myanmar: '), baked_version=null where position(':myanmar:' in raw)>0;
update posts set raw = replace(raw, ':cambodia:', ' :cambodia: '), baked_version=null where position(':cambodia:' in raw)>0;
update posts set raw = replace(raw, ':cameroon:', ' :cameroon: '), baked_version=null where position(':cameroon:' in raw)>0;
update posts set raw = replace(raw, ':canada:', ' :canada: '), baked_version=null where position(':canada:' in raw)>0;
update posts set raw = replace(raw, ':chile:', ' :chile: '), baked_version=null where position(':chile:' in raw)>0;
update posts set raw = replace(raw, ':cn:', ' :cn: '), baked_version=null where position(':cn:' in raw)>0;
update posts set raw = replace(raw, ':cote_divoire:', ' :cote_divoire: '), baked_version=null where position(':cote_divoire:' in raw)>0;
update posts set raw = replace(raw, ':colombia:', ' :colombia: '), baked_version=null where position(':colombia:' in raw)>0;
update posts set raw = replace(raw, ':comoros:', ' :comoros: '), baked_version=null where position(':comoros:' in raw)>0;
update posts set raw = replace(raw, ':costa_rica:', ' :costa_rica: '), baked_version=null where position(':costa_rica:' in raw)>0;
update posts set raw = replace(raw, ':croatia:', ' :croatia: '), baked_version=null where position(':croatia:' in raw)>0;
update posts set raw = replace(raw, ':cuba:', ' :cuba: '), baked_version=null where position(':cuba:' in raw)>0;
update posts set raw = replace(raw, ':cyprus:', ' :cyprus: '), baked_version=null where position(':cyprus:' in raw)>0;
update posts set raw = replace(raw, ':czech_republic:', ' :czech_republic: '), baked_version=null where position(':czech_republic:' in raw)>0;
update posts set raw = replace(raw, ':denmark:', ' :denmark: '), baked_version=null where position(':denmark:' in raw)>0;
update posts set raw = replace(raw, ':djibouti:', ' :djibouti: '), baked_version=null where position(':djibouti:' in raw)>0;
update posts set raw = replace(raw, ':timor_leste:', ' :timor_leste: '), baked_version=null where position(':timor_leste:' in raw)>0;
update posts set raw = replace(raw, ':ecuador:', ' :ecuador: '), baked_version=null where position(':ecuador:' in raw)>0;
update posts set raw = replace(raw, ':egypt:', ' :egypt: '), baked_version=null where position(':egypt:' in raw)>0;
update posts set raw = replace(raw, ':el_salvador:', ' :el_salvador: '), baked_version=null where position(':el_salvador:' in raw)>0;
update posts set raw = replace(raw, ':estonia:', ' :estonia: '), baked_version=null where position(':estonia:' in raw)>0;
update posts set raw = replace(raw, ':faroe_islands:', ' :faroe_islands: '), baked_version=null where position(':faroe_islands:' in raw)>0;
update posts set raw = replace(raw, ':finland:', ' :finland: '), baked_version=null where position(':finland:' in raw)>0;
update posts set raw = replace(raw, ':fr:', ' :fr: '), baked_version=null where position(':fr:' in raw)>0;
update posts set raw = replace(raw, ':gabon:', ' :gabon: '), baked_version=null where position(':gabon:' in raw)>0;
update posts set raw = replace(raw, ':de:', ' :de: '), baked_version=null where position(':de:' in raw)>0;
update posts set raw = replace(raw, ':ghana:', ' :ghana: '), baked_version=null where position(':ghana:' in raw)>0;
update posts set raw = replace(raw, ':greece:', ' :greece: '), baked_version=null where position(':greece:' in raw)>0;
update posts set raw = replace(raw, ':guatemala:', ' :guatemala: '), baked_version=null where position(':guatemala:' in raw)>0;
update posts set raw = replace(raw, ':guyana:', ' :guyana: '), baked_version=null where position(':guyana:' in raw)>0;
update posts set raw = replace(raw, ':hong_kong:', ' :hong_kong: '), baked_version=null where position(':hong_kong:' in raw)>0;
update posts set raw = replace(raw, ':hungary:', ' :hungary: '), baked_version=null where position(':hungary:' in raw)>0;
update posts set raw = replace(raw, ':iceland:', ' :iceland: '), baked_version=null where position(':iceland:' in raw)>0;
update posts set raw = replace(raw, ':india:', ' :india: '), baked_version=null where position(':india:' in raw)>0;
update posts set raw = replace(raw, ':indonesia:', ' :indonesia: '), baked_version=null where position(':indonesia:' in raw)>0;
update posts set raw = replace(raw, ':iran:', ' :iran: '), baked_version=null where position(':iran:' in raw)>0;
update posts set raw = replace(raw, ':iraq:', ' :iraq: '), baked_version=null where position(':iraq:' in raw)>0;
update posts set raw = replace(raw, ':ireland:', ' :ireland: '), baked_version=null where position(':ireland:' in raw)>0;
update posts set raw = replace(raw, ':israel:', ' :israel: '), baked_version=null where position(':israel:' in raw)>0;
update posts set raw = replace(raw, ':it:', ' :it: '), baked_version=null where position(':it:' in raw)>0;
update posts set raw = replace(raw, ':jamaica:', ' :jamaica: '), baked_version=null where position(':jamaica:' in raw)>0;
update posts set raw = replace(raw, ':japan:', ' :japan: '), baked_version=null where position(':japan:' in raw)>0;
update posts set raw = replace(raw, ':jordan:', ' :jordan: '), baked_version=null where position(':jordan:' in raw)>0;
update posts set raw = replace(raw, ':kazakhstan:', ' :kazakhstan: '), baked_version=null where position(':kazakhstan:' in raw)>0;
update posts set raw = replace(raw, ':kenya:', ' :kenya: '), baked_version=null where position(':kenya:' in raw)>0;
update posts set raw = replace(raw, ':kuwait:', ' :kuwait: '), baked_version=null where position(':kuwait:' in raw)>0;
update posts set raw = replace(raw, ':latvia:', ' :latvia: '), baked_version=null where position(':latvia:' in raw)>0;
update posts set raw = replace(raw, ':lebanon:', ' :lebanon: '), baked_version=null where position(':lebanon:' in raw)>0;
update posts set raw = replace(raw, ':liechtenstein:', ' :liechtenstein: '), baked_version=null where position(':liechtenstein:' in raw)>0;
update posts set raw = replace(raw, ':lithuania:', ' :lithuania: '), baked_version=null where position(':lithuania:' in raw)>0;
update posts set raw = replace(raw, ':luxembourg:', ' :luxembourg: '), baked_version=null where position(':luxembourg:' in raw)>0;
update posts set raw = replace(raw, ':macau:', ' :macau: '), baked_version=null where position(':macau:' in raw)>0;
update posts set raw = replace(raw, ':macedonia:', ' :macedonia: '), baked_version=null where position(':macedonia:' in raw)>0;
update posts set raw = replace(raw, ':madagascar:', ' :madagascar: '), baked_version=null where position(':madagascar:' in raw)>0;
update posts set raw = replace(raw, ':malawi:', ' :malawi: '), baked_version=null where position(':malawi:' in raw)>0;
update posts set raw = replace(raw, ':malaysia:', ' :malaysia: '), baked_version=null where position(':malaysia:' in raw)>0;
update posts set raw = replace(raw, ':maldives:', ' :maldives: '), baked_version=null where position(':maldives:' in raw)>0;
update posts set raw = replace(raw, ':malta:', ' :malta: '), baked_version=null where position(':malta:' in raw)>0;
update posts set raw = replace(raw, ':marshall_islands:', ' :marshall_islands: '), baked_version=null where position(':marshall_islands:' in raw)>0;
update posts set raw = replace(raw, ':mauritius:', ' :mauritius: '), baked_version=null where position(':mauritius:' in raw)>0;
update posts set raw = replace(raw, ':mexico:', ' :mexico: '), baked_version=null where position(':mexico:' in raw)>0;
update posts set raw = replace(raw, ':moldova:', ' :moldova: '), baked_version=null where position(':moldova:' in raw)>0;
update posts set raw = replace(raw, ':monaco:', ' :monaco: '), baked_version=null where position(':monaco:' in raw)>0;
update posts set raw = replace(raw, ':morocco:', ' :morocco: '), baked_version=null where position(':morocco:' in raw)>0;
update posts set raw = replace(raw, ':nepal:', ' :nepal: '), baked_version=null where position(':nepal:' in raw)>0;
update posts set raw = replace(raw, ':caribbean_netherlands:', ' :caribbean_netherlands: '), baked_version=null where position(':caribbean_netherlands:' in raw)>0;
update posts set raw = replace(raw, ':netherlands:', ' :netherlands: '), baked_version=null where position(':netherlands:' in raw)>0;
update posts set raw = replace(raw, ':new_zealand:', ' :new_zealand: '), baked_version=null where position(':new_zealand:' in raw)>0;
update posts set raw = replace(raw, ':nigeria:', ' :nigeria: '), baked_version=null where position(':nigeria:' in raw)>0;
update posts set raw = replace(raw, ':norway:', ' :norway: '), baked_version=null where position(':norway:' in raw)>0;
update posts set raw = replace(raw, ':pakistan:', ' :pakistan: '), baked_version=null where position(':pakistan:' in raw)>0;
update posts set raw = replace(raw, ':panama:', ' :panama: '), baked_version=null where position(':panama:' in raw)>0;
update posts set raw = replace(raw, ':peru:', ' :peru: '), baked_version=null where position(':peru:' in raw)>0;
update posts set raw = replace(raw, ':philippines:', ' :philippines: '), baked_version=null where position(':philippines:' in raw)>0;
update posts set raw = replace(raw, ':poland:', ' :poland: '), baked_version=null where position(':poland:' in raw)>0;
update posts set raw = replace(raw, ':portugal:', ' :portugal: '), baked_version=null where position(':portugal:' in raw)>0;
update posts set raw = replace(raw, ':puerto_rico:', ' :puerto_rico: '), baked_version=null where position(':puerto_rico:' in raw)>0;
update posts set raw = replace(raw, ':qatar:', ' :qatar: '), baked_version=null where position(':qatar:' in raw)>0;
update posts set raw = replace(raw, ':romania:', ' :romania: '), baked_version=null where position(':romania:' in raw)>0;
update posts set raw = replace(raw, ':ru:', ' :ru: '), baked_version=null where position(':ru:' in raw)>0;
update posts set raw = replace(raw, ':sao_tome_principe:', ' :sao_tome_principe: '), baked_version=null where position(':sao_tome_principe:' in raw)>0;
update posts set raw = replace(raw, ':saudi_arabia:', ' :saudi_arabia: '), baked_version=null where position(':saudi_arabia:' in raw)>0;
update posts set raw = replace(raw, ':singapore:', ' :singapore: '), baked_version=null where position(':singapore:' in raw)>0;
update posts set raw = replace(raw, ':slovakia:', ' :slovakia: '), baked_version=null where position(':slovakia:' in raw)>0;
update posts set raw = replace(raw, ':slovenia:', ' :slovenia: '), baked_version=null where position(':slovenia:' in raw)>0;
update posts set raw = replace(raw, ':south_africa:', ' :south_africa: '), baked_version=null where position(':south_africa:' in raw)>0;
update posts set raw = replace(raw, ':kr:', ' :kr: '), baked_version=null where position(':kr:' in raw)>0;
update posts set raw = replace(raw, ':es:', ' :es: '), baked_version=null where position(':es:' in raw)>0;
update posts set raw = replace(raw, ':st_lucia:', ' :st_lucia: '), baked_version=null where position(':st_lucia:' in raw)>0;
update posts set raw = replace(raw, ':sudan:', ' :sudan: '), baked_version=null where position(':sudan:' in raw)>0;
update posts set raw = replace(raw, ':sweden:', ' :sweden: '), baked_version=null where position(':sweden:' in raw)>0;
update posts set raw = replace(raw, ':switzerland:', ' :switzerland: '), baked_version=null where position(':switzerland:' in raw)>0;
update posts set raw = replace(raw, ':syria:', ' :syria: '), baked_version=null where position(':syria:' in raw)>0;
update posts set raw = replace(raw, ':taiwan:', ' :taiwan: '), baked_version=null where position(':taiwan:' in raw)>0;
update posts set raw = replace(raw, ':thailand:', ' :thailand: '), baked_version=null where position(':thailand:' in raw)>0;
update posts set raw = replace(raw, ':trinidad_tobago:', ' :trinidad_tobago: '), baked_version=null where position(':trinidad_tobago:' in raw)>0;
update posts set raw = replace(raw, ':tunisia:', ' :tunisia: '), baked_version=null where position(':tunisia:' in raw)>0;
update posts set raw = replace(raw, ':turkey:', ' :turkey: '), baked_version=null where position(':turkey:' in raw)>0;
update posts set raw = replace(raw, ':united_arab_emirates:', ' :united_arab_emirates: '), baked_version=null where position(':united_arab_emirates:' in raw)>0;
update posts set raw = replace(raw, ':uganda:', ' :uganda: '), baked_version=null where position(':uganda:' in raw)>0;
update posts set raw = replace(raw, ':uk:', ' :uk: '), baked_version=null where position(':uk:' in raw)>0;
update posts set raw = replace(raw, ':ukraine:', ' :ukraine: '), baked_version=null where position(':ukraine:' in raw)>0;
update posts set raw = replace(raw, ':uruguay:', ' :uruguay: '), baked_version=null where position(':uruguay:' in raw)>0;
update posts set raw = replace(raw, ':us:', ' :us: '), baked_version=null where position(':us:' in raw)>0;
update posts set raw = replace(raw, ':uzbekistan:', ' :uzbekistan: '), baked_version=null where position(':uzbekistan:' in raw)>0;
update posts set raw = replace(raw, ':vanuatu:', ' :vanuatu: '), baked_version=null where position(':vanuatu:' in raw)>0;
update posts set raw = replace(raw, ':vatican_city:', ' :vatican_city: '), baked_version=null where position(':vatican_city:' in raw)>0;
update posts set raw = replace(raw, ':venezuela:', ' :venezuela: '), baked_version=null where position(':venezuela:' in raw)>0;
update posts set raw = replace(raw, ':vietnam:', ' :vietnam: '), baked_version=null where position(':vietnam:' in raw)>0;
update posts set raw = replace(raw, ':zambia:', ' :zambia: '), baked_version=null where position(':zambia:' in raw)>0;
update posts set raw = replace(raw, ':zimbabwe:', ' :zimbabwe: '), baked_version=null where position(':zimbabwe:' in raw)>0;

(will not work for user without country)

julbrs commented 4 years ago

ok as we will reimport all content (#5)then no need for a fix on existing data, i close the case.