-- P5-4270: make state a freetext field

ALTER TABLE addresses
    ADD COLUMN state varchar;

UPDATE addresses
    SET state = (SELECT name FROM states WHERE code = addresses.state_code);

ALTER TABLE addresses
  DROP COLUMN state_code;

DROP TABLE states;
