/*
 * Copyright ©  2023 Thomas J Collinson
 * All rights reserved
 */

alter table email_settings
    add use_mailgun tinyint(1) default 0 not null;

create table if not exists system_addresses
(
    id         int unsigned auto_increment
        primary key,
    list_order smallint unsigned    not null,
    address    text charset latin1  not null,
    site_id    int unsigned         not null,
    widget     tinyint(1) default 0 not null
)
    collate = utf8mb4_unicode_ci;

create fulltext index address
    on system_addresses (address);

create table if not exists system_addresses_config
(
    site_id int unsigned    not null primary key,
    expires bigint unsigned not null default 0
) ENGINE = InnoDB
  collate = utf8mb4_unicode_ci;

alter table invoice_accounts
    add column if not exists ref varchar(50) null;