Add migration for templates table.
Implement Template function.