CREATE TABLE IF NOT EXISTS `app_settings` (
  `id`          INT AUTO_INCREMENT PRIMARY KEY,
  `key`         VARCHAR(100) NOT NULL UNIQUE,
  `value`       TEXT,
  `created_at`  TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
  `updated_at`  TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

INSERT INTO `app_settings` (`key`, `value`) VALUES
  ('dms_pms_base',                'PMS-Projekte'),
  ('dms_pms_prefix',              'P'),
  ('dms_pms_separator',           '-'),
  ('dms_pms_year_format',         '2'),
  ('dms_pms_id_digits',           '4'),
  ('dms_pms_include_kunde',       '1'),
  ('dms_pms_include_bv',          '1'),
  ('dms_pms_folder_angebot',      '01_Angebot'),
  ('dms_pms_folder_ab',           '02_Auftragsbestaetigung'),
  ('dms_pms_folder_auftrag',      '03_Auftrag'),
  ('dms_pms_folder_durchfuehrung','04_Durchfuehrung'),
  ('dms_pms_folder_rechnung',     '05_Rechnung')
ON DUPLICATE KEY UPDATE `value` = VALUES(`value`);
