SQLite table migration

Generic script to migrate one table from your Val Town account-based (global) database to a val-scoped database.

You can copy-paste the migrate.ts file into any val you'd like to migrate. Does not handle:

  • Multiple tables
  • Indexes
  • Triggers
  • Views

Townie (Normal mode, Claude Sonnet 4.6) was quite helpful in building this does-one-thing migrator, so I bet it would be straightforward to remix this val to handle any of the above. When running and testing your migration, the SQLite Explorer val (for global db) and built-in SQLite admin panel (for val db) are helpful.