ALTER TABLE {{ backquote(table) }} DROP PRIMARY KEY, ADD PRIMARY KEY( {% for field in selected %} {{ backquote(field) }} {%- if not loop.last %},{% endif %} {% endfor %} );