DROP TABLE IF EXISTS `v_homepage`;
DROP VIEW IF EXISTS `v_homepage`;

CREATE OR REPLACE VIEW `_mydb_index`.`v_homepage` AS 
SELECT m_homepage.id_homepage, m_homepage.id_account, m_homepage.id_category, m_category.c_categoryName, m_category.c_categoryDisplayColumn, m_category.c_categoryDisplayOrder, m_category.c_categoryDisplayColor, m_homepage.c_title, m_homepage.c_url, m_homepage.c_displayOrder, m_homepage.c_delete, m_homepage.c_privacy, m_homepage.c_html
FROM m_homepage
LEFT OUTER JOIN m_category ON m_homepage.id_category = m_category.id_category
WHERE m_homepage.c_delete = 0;



DROP TABLE IF EXISTS `v_mynews`;
DROP VIEW IF EXISTS `v_mynews`;

CREATE OR REPLACE VIEW `_mydb_index`.`v_mynews` AS 
SELECT m_mynews.*, r_andor.c_andor
FROM m_mynews
LEFT OUTER JOIN r_andor ON m_mynews.id_andor = r_andor.id_andor
WHERE m_mynews.c_delete = 0;
