You just need to set the languageId variable, and the statement will clone all the default templates just with a different language set.


For MS SQL

begin tran

declare @languageId uniqueidentifier = 'AEDE0926-60BC-4801-AAC6-01491832DE84'

insert into template
(id, name, content, tag, description, created_time, last_change_time, fk_account_id, fk_language_id, number_of_lines, type)
select NEWID(), name, content, tag, description, created_time, last_change_time, fk_account_id, @languageId, number_of_lines, type
from template
where 
name not like 'customization%'

--rollback
--commit 

  

For PostgreSQL

insert into "template"
(id, name, content, tag, description, created_time, last_change_time, fk_account_id, fk_language_id, number_of_lines, type)
select uuid_generate_v4(), name, content, tag, description, created_time, last_change_time, fk_account_id, '8c8136a3-31eb-4fce-b88e-823b3df9c1d7', number_of_lines, type
from "template"
where
name not ilike 'customization%';


Do not forget to change unique language UUID in the query to one that you would like to enable.