create table public.mail_configuration
(
  customer text not null,
  sender text not null,
  return_debit_note_mail_active boolean default false not null,
  return_debit_note_receiver text,
  return_debit_note_subject text,
  return_debit_note_body text,
  r2_host text,
  r2_firma integer
);

alter table public.mail_configuration owner to paymenthub;

create table public.payone_return_debit_note
(
  id bigserial not null,
  customer text not null
    constraint payone_return_debit_note_payone_configuration_customer_fk
      references public.payone_configuration
      on update restrict on delete restrict,
  txid text not null,
  notification jsonb not null,
  notified_at timestamp not null,
  mail_send boolean default false not null
);

alter table public.payone_return_debit_note owner to paymenthub;
