SET NAMES utf8;
     CREATE TABLE crm_log_template (
        lp INT AUTO_INCREMENT, 
        fldname VARCHAR(64) NOT NULL,
        zmiana_dotyczy VARCHAR(38) NOT NULL,
        old VARCHAR(250),
        new VARCHAR(250) NOT NULL,
        PRIMARY KEY (lp),
        UNIQUE KEY (fldname)
    );

    INSERT INTO crm_log_template VALUES
    (0, 'progress','CHANGE_PROGRESS', 'Stopień zaawansowania: {old}%', 'Stopień zaawansowania: {new}%'),
    (0, 'status','CHANGE_STATUS', 'Status: {old}', 'Status: {new}'),
    (0, 'temat','CHANGE_TITLE', 'Temat: {old}', 'Temat: {new}'),
    (0, 'priorytet','CHANGE_PRIORITY', 'Priorytet: {old}', 'Priorytet: {new}'),
    (0, 'starttime','CHANGE_DATE', 'Od: {old}', 'Od: {new}'),
    (0, 'endtime','CHANGE_DATE', 'Do: {old}', 'Do: {new}'),
    (0, 'duration','CHANGE_DATE', 'Czas: {old}', 'Czas: {new}'),
    (0, 'work_starttime','CHANGE_DATE', 'Praca od: {old}', 'Praca od: {new}'),
    (0, 'work_endtime','CHANGE_DATE', 'Praca do: {old}', 'Praca do: {new}'),
    (0, 'work_duration','CHANGE_DATE', 'faktyczny czas: {old}', 'faktyczny czas: {new}'),
    (0, 'opis','CHANGE_DESCR', 'Opis: {old}', 'Opis: {new}'),
    (0, '_komentarz','ADD_COMMENT', '', 'Komentarz: {new}'),
    (0, '_users','CHANGE_USERS', '', 'Zmiana osób w szufladkach'),
    (0, '_time','TIME_SHEET', '', 'Czas pracy: {new}h ({newvalue_str})'),
    (0, '_init','CREATE', '', '{new}');
