Add migration for SQL tables. Fixes issues related to #255