CREATE TABLE webcal_config ( cal_setting VARCHAR(50) NOT NULL, cal_value VARCHAR(100) DEFAULT NULL, PRIMARY KEY (cal_setting) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_user ( cal_login VARCHAR(25) NOT NULL, cal_passwd VARCHAR(128) DEFAULT NULL, cal_lastname VARCHAR(25) DEFAULT NULL, cal_firstname VARCHAR(25) DEFAULT NULL, cal_is_admin CHAR(1) DEFAULT 'N', cal_email VARCHAR(100) DEFAULT NULL, cal_enabled CHAR(1) DEFAULT 'Y', PRIMARY KEY (cal_login) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_entry ( cal_id INT NOT NULL, cal_group_id INT DEFAULT NULL, cal_create_by VARCHAR(25) NOT NULL, cal_date INT NOT NULL, cal_time INT DEFAULT NULL, cal_mod_date INT DEFAULT NULL, cal_mod_time INT DEFAULT NULL, cal_duration INT NOT NULL, cal_priority INT DEFAULT 5, cal_type CHAR(1) DEFAULT 'E', cal_access CHAR(1) DEFAULT 'P', cal_name VARCHAR(80) NOT NULL, cal_description TEXT, cal_location VARCHAR(100) DEFAULT NULL, cal_url VARCHAR(255) DEFAULT NULL, PRIMARY KEY (cal_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_entry_user ( cal_id INT NOT NULL, cal_login VARCHAR(25) NOT NULL, cal_status CHAR(1) DEFAULT 'A', cal_category INT DEFAULT NULL, cal_percent INT DEFAULT 0, PRIMARY KEY (cal_id, cal_login) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_entry_repeats ( cal_id INT NOT NULL, cal_type VARCHAR(20) DEFAULT NULL, cal_end INT DEFAULT NULL, cal_frequency INT DEFAULT 1, cal_days CHAR(7) DEFAULT NULL, cal_monthday INT DEFAULT NULL, cal_dayofweek INT DEFAULT NULL, PRIMARY KEY (cal_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_entry_repeats_not ( cal_id INT NOT NULL, cal_date INT NOT NULL, PRIMARY KEY (cal_id, cal_date) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_user_pref ( cal_login VARCHAR(25) NOT NULL, cal_setting VARCHAR(50) NOT NULL, cal_value VARCHAR(100) DEFAULT NULL, PRIMARY KEY (cal_login, cal_setting) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_user_layers ( cal_login VARCHAR(25) NOT NULL, cal_layeruser VARCHAR(25) NOT NULL, cal_color VARCHAR(25) DEFAULT NULL, cal_dups CHAR(1) DEFAULT 'N', cal_order INT DEFAULT 0, PRIMARY KEY (cal_login, cal_layeruser) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_site_extras ( cal_id INT NOT NULL, cal_name VARCHAR(25) NOT NULL, cal_type INT NOT NULL, cal_date INT DEFAULT 0, cal_remind INT DEFAULT 0, cal_data TEXT, PRIMARY KEY (cal_id, cal_name) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_group ( cal_group_id INT NOT NULL, cal_owner VARCHAR(25) DEFAULT NULL, cal_name VARCHAR(50) NOT NULL, cal_last_update INT NOT NULL, PRIMARY KEY (cal_group_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_group_user ( cal_group_id INT NOT NULL, cal_login VARCHAR(25) NOT NULL, PRIMARY KEY (cal_group_id, cal_login) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_view ( cal_view_id INT NOT NULL, cal_owner VARCHAR(25) NOT NULL, cal_name VARCHAR(50) NOT NULL, cal_view_type CHAR(1) DEFAULT 'W', PRIMARY KEY (cal_view_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_view_user ( cal_view_id INT NOT NULL, cal_login VARCHAR(25) NOT NULL, PRIMARY KEY (cal_view_id, cal_login) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_config_defaults ( cal_setting VARCHAR(50) NOT NULL, cal_value VARCHAR(100) DEFAULT NULL, PRIMARY KEY (cal_setting) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_reminders ( cal_id INT NOT NULL, cal_date INT NOT NULL, cal_time INT NOT NULL, cal_offset INT DEFAULT 0, cal_related CHAR(1) DEFAULT 'S', cal_before CHAR(1) DEFAULT 'Y', cal_last_sent INT DEFAULT 0, cal_repeats INT DEFAULT 0, cal_duration INT DEFAULT 0, cal_action VARCHAR(12) DEFAULT 'EMAIL', PRIMARY KEY (cal_id, cal_date, cal_time) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_nonuser_cals ( cal_login VARCHAR(25) NOT NULL, cal_lastname VARCHAR(25) DEFAULT NULL, cal_firstname VARCHAR(25) DEFAULT NULL, cal_admin VARCHAR(25) NOT NULL, cal_access CHAR(1) DEFAULT 'P', cal_url VARCHAR(255) DEFAULT NULL, PRIMARY KEY (cal_login) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_import ( cal_import_id INT NOT NULL, cal_name VARCHAR(50) DEFAULT NULL, cal_date INT NOT NULL, cal_type VARCHAR(10) NOT NULL, cal_login VARCHAR(25) DEFAULT NULL, PRIMARY KEY (cal_import_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_import_data ( cal_id INT NOT NULL, cal_login VARCHAR(25) NOT NULL, cal_external_id VARCHAR(200) DEFAULT NULL, cal_import_id INT NOT NULL, cal_import_type VARCHAR(15) NOT NULL, PRIMARY KEY (cal_id, cal_login) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_categories ( cat_id INT NOT NULL, cat_name VARCHAR(80) NOT NULL, cat_owner VARCHAR(25) DEFAULT NULL, PRIMARY KEY (cat_id) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
CREATE TABLE webcal_entry_categories ( cal_id INT NOT NULL DEFAULT 0, cat_id INT NOT NULL DEFAULT 0, cat_order INT NOT NULL DEFAULT 0, cat_owner VARCHAR(25) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
INSERT INTO webcal_config (cal_setting, cal_value) VALUES ('WEBCAL_PROGRAM_VERSION', 'v1.3.0');
INSERT INTO webcal_user (cal_login, cal_passwd, cal_firstname, cal_lastname, cal_is_admin, cal_email, cal_enabled) VALUES ('admin', '202cb962ac59075b964b07152d234b70', 'Admin', 'User', 'Y', 'admin@example.com', 'Y');
INSERT INTO webcal_config (cal_setting, cal_value) VALUES ('LANGUAGE', 'English');
INSERT INTO webcal_config (cal_setting, cal_value) VALUES ('STARTVIEW', 'month');
