create table f_dealer_users
(
    id int(5) unsigned auto_increment
        primary key,
    auth0_id int default 0 not null,
    old_id int(10) not null,
    pass text null,
    name text null,
    name_title varchar(50) default '' not null,
    initials varchar(10) not null,
    company int(4) not null,
    default_address int(5) not null,
    email text null,
    cc_email varchar(250) default '' not null,
    tel varchar(200) not null,
    birthday int(1) not null,
    active tinyint(1) default 1 not null,
    can_login int(1) not null,
    submit_orders_disabled int(1) default 0 not null,
    multifactor_auth int default 0 not null,
    disable_auth0_until varchar(10) null comment 'date until when auth0 is disabled',
    rfo int(2) not null,
    logins tinyint(2) default 0 not null,
    start_page varchar(30) not null,
    results int(5) not null,
    units varchar(2) default 'mm' not null,
    language varchar(2) default 'en' not null,
    dimensions int(1) not null,
    admin int(1) not null,
    restricted int(1) not null,
    user_type varchar(250) default '' not null,
    no_prices int(1) not null,
    deviations int(1) not null,
    show_login_change int(1) not null,
    same_user int(1) not null,
    sales_report int(2) not null comment '1-in table, 2-can only see table, 3 - can see table and be in table',
    projects int(1) not null,
    show_project_production_prices int(1) not null,
    stock int(1) not null,
    stock_access varchar(255) not null,
    stock_default int(3) not null,
    stock_order_duplicate int(1) not null,
    show_rfo int(1) default 1 not null,
    show_category int(1) default 1 not null,
    show_summe int(1) default 1 not null,
    show_qty int(1) default 1 not null,
    show_ordered int(1) default 1 not null,
    show_total int(1) default 1 not null,
    show_alert int(1) default 1 not null,
    show_order int(1) default 1 not null,
    show_weight int(1) default 1 not null,
    show_eurocard int default 0 not null,
    child_safety_warnings int(1) default 1 not null,
    curtains_fabrics int(1) not null,
    my_orders int(1) not null,
    send_copy int(1) not null,
    text_order_confirmation_email text not null,
    text_quotation_email text not null,
    text_quotation_top1 text not null,
    text_quotation_top2 text not null,
    text_quotation_top3 text not null,
    text_quotation_top4 text not null,
    text_quotation_bot1 text not null,
    text_quotation_bot2 text not null,
    text_quotation_bot3 text not null,
    text_quotation_bot4 text not null,
    followup_text text not null,
    followup_text_last text not null,
    token text not null,
    token_date varchar(10) default '0000-00-00' not null,
    login_date varchar(20) default '0000-00-00' not null,
    modification_date timestamp default CURRENT_TIMESTAMP not null,
    user_tripletex_integration int not null,
    employee_token text not null,
    fortnox_integration int(1) not null,
    fortnox_access_token text not null,
    fortnox_remember_token text not null,
    fortnox_access_token_date timestamp default '1970-01-02 00:00:00' not null,
    fortnox_remember_token_date timestamp default '1970-01-02 00:00:00' not null,
    fortnox_client_secret text not null,
    create_date timestamp default CURRENT_TIMESTAMP not null,
    update_date timestamp default CURRENT_TIMESTAMP not null on update CURRENT_TIMESTAMP
)
    charset=utf8;

