pinballmap / pbm

Pinball Map
https://pinballmap.com
GNU General Public License v3.0
108 stars 25 forks source link

Find/replace the wrong apostrophes #813

Closed RyanTG closed 3 years ago

RyanTG commented 6 years ago

Example: Lucky’s Bar & Grill

RyanTG commented 6 years ago

Done. Might have to do this for other fields.

glowing-dusk-5085::COBALT=> select r.name as region_name, l.name as location_name, m.name as machine_name, m.id as machine_id from location_machine_xrefs x inner join locations l on (l.id = x.location_id) inner join machines m on (m.id = x.machine_id) inner join regions r on (l.region_id = r.id) where l.name ilike '%’%';

  region_name   |         location_name         |        machine_name        | machine_id 
----------------+-------------------------------+----------------------------+------------
 buffalo        | John & Mary’s-Alden           | Mario Andretti             |       1117
 buffalo        | John & Mary’s-Depew           | The Sopranos               |        645
 portland       | Maxwell’s Restaurant & Lounge | The Simpsons Pinball Party |        682
 buffalo        | TF Brown’s Restaurant         | Game of Thrones (Pro)      |       2441
 buffalo        | John & Mary’s-Batavia         | Tee'd Off                  |        898
 buffalo        | Odie’s                        | Game of Thrones (LE)       |       2442
 southflorida   | Capt Tony’s Saloon            | Star Trek (Pro)            |       2165
 chicago        | KC’s Cabin                    | The Walking Dead (LE)      |       2214
 buffalo        | John & Mary’s-Cheektowaga     | Shaq Attaq                 |       1276
 bayarea        | Chris’s New Harbor Bar        | Red & Ted's Road Show      |        680
 austin         | Riley’s Tavern                | Jurassic Park              |        691
 austin         | Riley’s Tavern                | Flip Flop                  |       1927
 southflorida   | Beef O Brady’s                | Shrek                      |        701
 southflorida   | Beef O Brady’s                | Metallica (Premium)        |       1606
 southflorida   | Beef O Brady’s                | Ghostbusters (Premium)     |       2570
 southflorida   | Beef O Brady’s                | Guns 'N Roses              |        700
 san-antonio    | What’s Brewing?               | Gorgar                     |        902
 san-antonio    | What’s Brewing?               | F-14 Tomcat                |        751
 san-antonio    | What’s Brewing?               | Taxi                       |        779
 san-antonio    | What’s Brewing?               | High Speed                 |        672
 san-antonio    | What’s Brewing?               | PIN-BOT                    |        723
 chicago        | Chain O’Lakes Brewing Company | Elvis                      |        668
 massachusetts  | Jack’s Lounge                 | The Sopranos               |        645
 ca-central     | Elsie’s                       | Flash                      |        875
 raleigh-durham | Michelangelo’s Pizza          | The Addams Family          |        687
 kansascity     | Johnny’s Tavern               | Wrestlemania               |       2277
(26 rows)
RyanTG commented 5 years ago

That query isn't working anymore. But I found all in location names using rails admin. Found 67, and I replaced them manually.

RyanTG commented 2 years ago

update locations set name = replace(name, '’', '''') where name ilike '%’%';