-- Towns whose customers can choose local pickup. A customer's delivery ZIP must belong to a town that is switched on.
-- Each town can have more than one ZIP code (comma separated). The owner adds, turns off and removes towns in Admin, Shipping and tax.
CREATE TABLE pickup_towns (
  id         INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,
  name       VARCHAR(80) NOT NULL,
  zips       VARCHAR(120) NOT NULL,                       -- "04971" or "04971, 04972"
  active     TINYINT(1) NOT NULL DEFAULT 1,
  sort_order INT NOT NULL DEFAULT 0,
  created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB;

INSERT INTO pickup_towns (name, zips, active, sort_order) VALUES
  ('Saint Albans', '04971', 1, 1),
  ('Newport',      '04953', 1, 2),
  ('Pittsfield',   '04967', 1, 3),
  ('Dexter',       '04930', 1, 4),
  ('Harmony',      '04942', 1, 5),
  ('Hartland',     '04943', 1, 6),
  ('Palmyra',      '04965', 1, 7);
