DROP TABLE IF EXISTS `v_schedule`;
DROP VIEW IF EXISTS `v_schedule`;

CREATE OR REPLACE VIEW `_db_calendar`.`v_schedule` AS 
SELECT m_schedule.id_schedule, m_schedule.id_account, m_schedule.c_date, m_schedule.c_time1, m_schedule.c_time2, m_schedule.c_subject, m_schedule.c_memo, m_schedule.c_updatetime, m_schedule.c_delete, m_schedule.c_privacy, m_schedule.id_category, m_category.c_categoryName, m_category.c_categoryDisplayColor, m_category.c_iconImage, m_schedule.c_attachFile1, m_schedule.c_attachFile2, m_schedule.c_attachFile3, m_schedule.id_group, m_schedule.c_map
FROM m_schedule
LEFT OUTER JOIN m_category ON m_schedule.id_category = m_category.id_category
WHERE m_schedule.c_delete = 0;
