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

alter table airport_widget_settings
    add pickup_address varchar(1000) null;

alter table airport_widget_settings
    add success_text varchar(1000) null;

alter table airport_widget_settings
    add success_image varchar(500) null;

CREATE TABLE `stripe_api_keys`
(
    `id`                    INT UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
    `public_key`            VARCHAR(100)             NOT NULL,
    `private_key`           VARCHAR(100)             NOT NULL,
    `statement_descriptor`  VARCHAR(50)              NULL,
    `currency`              VARCHAR(5) DEFAULT 'GBP' NOT NULL
)ENGINE = InnoDB
 CHARSET = `utf8mb4` COLLATE = utf8mb4_unicode_ci;

create table dispatch_system_stripe_rel
(
    stripe_idfk          int unsigned not null,
    dispatch_system_idfk int unsigned not null,
    constraint dispatch_system_stripe_rel_pk
        primary key (dispatch_system_idfk),
    constraint dispatch_system_stripe_rel_dispatch_systems_id_fk
        foreign key (dispatch_system_idfk) references dispatch_systems (id),
    constraint dispatch_system_stripe_rel_stripe_api_keys_id_fk
        foreign key (stripe_idfk) references stripe_api_keys (id)
)ENGINE = InnoDB
 CHARSET = `utf8mb4` COLLATE = utf8mb4_unicode_ci;

create table booking_idempotency_keys
(
    id      int UNSIGNED auto_increment,
    expires int UNSIGNED not null,
    uuid    varchar(36)  not null,
    constraint booking_idempotency_keys_pk
        primary key (id)
)
    collate = utf8mb4_unicode_ci;