-- https://www.phpmyadmin.net/
--

START TRANSACTION;



-- --------------------------------------------------------

--
-- Table structure for table `app_config`
--

CREATE TABLE `app_config` (
  `id` int(11) NOT NULL,
  `config_key` varchar(100) NOT NULL,
  `config_value` text DEFAULT NULL,
  `config_type` enum('string','number','boolean','json') DEFAULT 'string',
  `description` text DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT 1,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `app_config`
--

INSERT INTO `app_config` (`id`, `config_key`, `config_value`, `config_type`, `description`, `is_public`, `created_at`, `updated_at`) VALUES
(1, 'app_name', 'Telugu News App', 'string', 'Application name', 1, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(2, 'app_version', '1.0.0', 'string', 'Current app version', 1, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(3, 'api_version', '1.0', 'string', 'API version', 1, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(4, 'maintenance_mode', 'false', 'boolean', 'Maintenance mode status', 1, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(5, 'news_per_page', '10', 'number', 'Number of news items per page', 0, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(6, 'shopping_per_page', '20', 'number', 'Number of shopping items per page', 0, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(7, 'enable_notifications', 'true', 'boolean', 'Enable push notifications', 0, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(8, 'default_news_category', 'general', 'string', 'Default news category', 0, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(9, 'app_theme_color', '#FF9800', 'string', 'App primary theme color', 1, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(10, 'contact_email', 'admin@localkey.app', 'string', 'Contact email address', 1, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(11, 'privacy_policy_url', 'https://localkey.app/telugu/privacy', 'string', 'Privacy policy URL', 1, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(12, 'terms_of_service_url', 'https://localkey.app/telugu/terms', 'string', 'Terms of service URL', 1, '2025-08-26 18:23:28', '2025-08-26 18:23:28');

-- --------------------------------------------------------

--
-- Table structure for table `app_settings`
--

CREATE TABLE `app_settings` (
  `id` int(11) NOT NULL,
  `setting_key` varchar(100) NOT NULL,
  `setting_value` text DEFAULT NULL,
  `setting_type` enum('text','number','boolean','json','url','email') DEFAULT 'text',
  `category` varchar(50) DEFAULT 'general',
  `description` text DEFAULT NULL,
  `is_public` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `app_settings`
--

INSERT INTO `app_settings` (`id`, `setting_key`, `setting_value`, `setting_type`, `category`, `description`, `is_public`, `created_at`, `updated_at`) VALUES
(1, 'app_name', 'Telugu News App', 'text', 'general', 'Application name displayed to users', 1, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(2, 'app_version', '1.0.0', 'text', 'general', 'Current application version', 1, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(3, 'app_description', 'Your trusted source for Telugu news, panchang, horoscope and shopping deals', 'text', 'general', 'Application description', 1, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(4, 'contact_email', 'support@telugunews.com', 'email', 'general', 'Contact email for support', 1, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(5, 'privacy_policy_url', 'https://telugunews.com/privacy', 'url', 'general', 'Privacy policy URL', 1, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(6, 'terms_url', 'https://telugunews.com/terms', 'url', 'general', 'Terms of service URL', 1, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(7, 'api_rate_limit', '100', 'number', 'api', 'API requests per minute per user', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(8, 'max_news_per_page', '20', 'number', 'api', 'Maximum news items per API response', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(9, 'cache_duration', '300', 'number', 'api', 'Cache duration in seconds', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(10, 'enable_push_notifications', '1', 'boolean', 'notifications', 'Enable push notifications', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(11, 'onesignal_app_id', '', 'text', 'notifications', 'OneSignal App ID', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(12, 'onesignal_api_key', '', 'text', 'notifications', 'OneSignal REST API Key', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(13, 'admob_app_id', '', 'text', 'ads', 'AdMob Application ID', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(14, 'admob_banner_unit_id', '', 'text', 'ads', 'AdMob Banner Ad Unit ID', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(15, 'admob_interstitial_unit_id', '', 'text', 'ads', 'AdMob Interstitial Ad Unit ID', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(16, 'enable_ads', '1', 'boolean', 'ads', 'Enable advertisements', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(17, 'maintenance_mode', '0', 'boolean', 'general', 'Enable maintenance mode', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(18, 'maintenance_message', 'App is under maintenance. Please try again later.', 'text', 'general', 'Maintenance mode message', 1, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(19, 'force_update_version', '', 'text', 'general', 'Force update for versions below this', 0, '2025-08-27 03:28:29', '2025-08-27 03:28:29'),
(20, 'update_message', 'Please update to the latest version for better experience.', 'text', 'general', 'Update message for users', 1, '2025-08-27 03:28:29', '2025-08-27 03:28:29');

-- --------------------------------------------------------

--
-- Table structure for table `backup_logs`
--

CREATE TABLE `backup_logs` (
  `id` int(11) NOT NULL,
  `backup_type` enum('full','partial','restore') NOT NULL,
  `filename` varchar(255) DEFAULT NULL,
  `file_size` bigint(20) DEFAULT NULL,
  `tables_included` text DEFAULT NULL,
  `status` enum('success','failed','in_progress') DEFAULT 'in_progress',
  `error_message` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `completed_at` timestamp NULL DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `daily_stats`
--

CREATE TABLE `daily_stats` (
  `id` int(11) NOT NULL,
  `date` date NOT NULL,
  `total_users` int(11) DEFAULT 0,
  `new_users` int(11) DEFAULT 0,
  `active_users` int(11) DEFAULT 0,
  `news_views` int(11) DEFAULT 0,
  `panchang_views` int(11) DEFAULT 0,
  `horoscope_views` int(11) DEFAULT 0,
  `shopping_views` int(11) DEFAULT 0,
  `api_calls` int(11) DEFAULT 0,
  `push_notifications_sent` int(11) DEFAULT 0,
  `ad_impressions` int(11) DEFAULT 0,
  `ad_clicks` int(11) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `daily_stats`
--

INSERT INTO `daily_stats` (`id`, `date`, `total_users`, `new_users`, `active_users`, `news_views`, `panchang_views`, `horoscope_views`, `shopping_views`, `api_calls`, `push_notifications_sent`, `ad_impressions`, `ad_clicks`, `created_at`, `updated_at`) VALUES
(1, '2025-07-29', 1935, 83, 270, 4026, 313, 532, 426, 6510, 771, 3071, 248, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(2, '2025-07-30', 1665, 22, 348, 4452, 273, 932, 357, 11809, 898, 2641, 130, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(3, '2025-07-31', 528, 53, 563, 3014, 334, 417, 368, 11269, 485, 7696, 255, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(4, '2025-08-01', 1937, 17, 552, 1868, 661, 830, 413, 11005, 261, 6275, 68, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(5, '2025-08-02', 1333, 21, 205, 3499, 438, 904, 188, 18667, 407, 9526, 227, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(6, '2025-08-03', 1280, 18, 228, 3298, 495, 947, 277, 15870, 377, 9617, 233, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(7, '2025-08-04', 1805, 22, 264, 2876, 750, 461, 429, 12688, 801, 6753, 206, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(8, '2025-08-05', 1076, 97, 710, 2514, 521, 884, 117, 11766, 574, 5944, 274, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(9, '2025-08-06', 751, 84, 265, 3931, 741, 687, 208, 15125, 325, 7444, 265, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(10, '2025-08-07', 1024, 51, 657, 4488, 302, 1053, 126, 14403, 133, 2372, 160, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(11, '2025-08-08', 728, 15, 456, 3288, 634, 747, 258, 18733, 856, 2491, 253, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(12, '2025-08-09', 744, 93, 479, 4866, 234, 518, 424, 16450, 470, 4255, 78, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(13, '2025-08-10', 789, 62, 297, 2351, 614, 925, 439, 15934, 204, 3019, 90, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(14, '2025-08-11', 1909, 78, 248, 2085, 733, 728, 142, 15442, 382, 8123, 261, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(15, '2025-08-12', 535, 22, 383, 1930, 720, 437, 242, 13184, 852, 4464, 107, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(16, '2025-08-13', 1111, 16, 732, 2823, 737, 799, 380, 19163, 402, 4741, 135, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(17, '2025-08-14', 581, 76, 792, 2034, 297, 326, 358, 13289, 522, 7802, 273, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(18, '2025-08-15', 961, 99, 632, 4506, 382, 596, 500, 9064, 184, 6565, 240, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(19, '2025-08-16', 556, 64, 344, 1553, 560, 774, 446, 19344, 450, 8144, 176, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(20, '2025-08-17', 732, 89, 657, 1513, 393, 585, 485, 10145, 476, 9474, 101, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(21, '2025-08-18', 878, 92, 714, 3686, 800, 360, 419, 16003, 451, 6559, 125, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(22, '2025-08-19', 1670, 64, 305, 4788, 422, 1056, 271, 9280, 169, 8574, 260, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(23, '2025-08-20', 1025, 59, 200, 2738, 549, 1137, 500, 12174, 849, 2747, 116, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(24, '2025-08-21', 715, 53, 701, 2621, 397, 497, 235, 17450, 803, 4777, 297, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(25, '2025-08-22', 605, 90, 758, 1320, 729, 438, 488, 9341, 547, 2581, 276, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(26, '2025-08-23', 1201, 67, 593, 1364, 746, 1071, 492, 15743, 231, 3536, 255, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(27, '2025-08-24', 1799, 49, 698, 2344, 658, 836, 172, 5541, 647, 3092, 201, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(28, '2025-08-25', 1771, 95, 736, 1334, 392, 1025, 404, 11702, 400, 2001, 80, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(29, '2025-08-26', 1682, 85, 559, 2774, 592, 1176, 175, 11194, 995, 2978, 174, '2025-08-27 03:29:19', '2025-08-27 03:29:19'),
(30, '2025-08-27', 861, 76, 369, 2814, 347, 386, 331, 7886, 579, 3475, 60, '2025-08-27 03:29:19', '2025-08-27 03:29:19');

-- --------------------------------------------------------

--
-- Table structure for table `horoscope`
--

CREATE TABLE `horoscope` (
  `id` int(11) NOT NULL,
  `date` date NOT NULL,
  `sign` varchar(50) NOT NULL,
  `prediction` text DEFAULT NULL,
  `lucky_number` int(11) DEFAULT NULL,
  `lucky_color` varchar(50) DEFAULT NULL,
  `lucky_time` varchar(100) DEFAULT NULL,
  `compatibility` varchar(50) DEFAULT NULL,
  `health` text DEFAULT NULL,
  `career` text DEFAULT NULL,
  `finance` text DEFAULT NULL,
  `love` text DEFAULT NULL,
  `general` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `horoscope_items`
--

CREATE TABLE `horoscope_items` (
  `id` int(11) NOT NULL,
  `date` date NOT NULL,
  `zodiac_sign` enum('aries','taurus','gemini','cancer','leo','virgo','libra','scorpio','sagittarius','capricorn','aquarius','pisces') NOT NULL,
  `daily_prediction` text DEFAULT NULL,
  `love_prediction` text DEFAULT NULL,
  `career_prediction` text DEFAULT NULL,
  `health_prediction` text DEFAULT NULL,
  `finance_prediction` text DEFAULT NULL,
  `lucky_number` varchar(20) DEFAULT NULL,
  `lucky_color` varchar(50) DEFAULT NULL,
  `lucky_time` varchar(50) DEFAULT NULL,
  `compatibility_sign` varchar(50) DEFAULT NULL,
  `overall_rating` tinyint(4) DEFAULT 3 CHECK (`overall_rating` >= 1 and `overall_rating` <= 5),
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `horoscope_items`
--

INSERT INTO `horoscope_items` (`id`, `date`, `zodiac_sign`, `daily_prediction`, `love_prediction`, `career_prediction`, `health_prediction`, `finance_prediction`, `lucky_number`, `lucky_color`, `lucky_time`, `compatibility_sign`, `overall_rating`, `created_at`, `updated_at`) VALUES
(1, '2025-08-26', 'aries', 'ఈ రోజు మీకు అనుకూల సమయం. కొత్త పనులు మొదలుపెట్టడానికి మంచి రోజు.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(2, '2025-08-26', 'taurus', 'ఆర్థిక విషయాలలో జాగ్రత్త అవసరం. పెద్ద నిర్ణయాలు తీసుకోవడంలో ఆలస్యం చేయండి.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(3, '2025-08-26', 'gemini', 'కుటుంబ సభ్యులతో మంచి సమయం గడపండి. స్నేహితుల మద్దతు లభిస్తుంది.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(4, '2025-08-26', 'cancer', 'కెరీర్‌లో మంచి అవకాశాలు రాబోతున్నాయి. కష్టపడి పని చేస్తే మంచి ఫలితాలు వస్తాయి.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 5, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(5, '2025-08-26', 'leo', 'ఆరోగ్య విషయాలలో జాగ్రత్త అవసరం. వ్యాయామం చేయడం మంచిది.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(6, '2025-08-26', 'virgo', 'విద్యార్థులకు మంచి రోజు. పరీక్షలలో మంచి మార్కులు వస్తాయి.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(7, '2025-08-26', 'libra', 'ప్రేమ విషయాలలో మంచి పరిణామాలు ఉంటాయి. కొత్త స్నేహాలు ఏర్పడతాయి.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(8, '2025-08-26', 'scorpio', 'వ్యాపార విషయాలలో జాగ్రత్త అవసరం. భాగస్వాములతో చర్చించి నిర్ణయాలు తీసుకోండి.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(9, '2025-08-26', 'sagittarius', 'ప్రయాణాలు మంచి ఫలితాలు ఇస్తాయి. కొత్త అనుభవాలు లభిస్తాయి.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(10, '2025-08-26', 'capricorn', 'కష్టపడి పని చేస్తే మంచి ఫలితాలు వస్తాయి. ఓపిక అవసరం.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 3, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(11, '2025-08-26', 'aquarius', 'సామాజిక కార్యక్రమాలలో పాల్గొనండి. కొత్త అవకాశాలు దొరుకుతాయి.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, '2025-08-26 18:23:28', '2025-08-26 18:23:28'),
(12, '2025-08-26', 'pisces', 'ఆధ్యాత్మిక విషయాలపై దృష్టి పెట్టండి. మానసిక శాంతి లభిస్తుంది.', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 4, '2025-08-26 18:23:28', '2025-08-26 18:23:28');

-- --------------------------------------------------------

--
-- Table structure for table `news`
--

CREATE TABLE `news` (
  `id` int(11) NOT NULL,
  `title` varchar(500) NOT NULL,
  `content` text DEFAULT NULL,
  `summary` text DEFAULT NULL,
  `image_url` varchar(500) DEFAULT NULL,
  `category` varchar(100) DEFAULT NULL,
  `source` varchar(200) DEFAULT NULL,
  `author` varchar(100) DEFAULT NULL,
  `is_featured` tinyint(1) DEFAULT 0,
  `is_breaking` tinyint(1) DEFAULT 0,
  `status` enum('published','draft') DEFAULT 'published',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `news_items`
--

CREATE TABLE `news_items` (
  `id` int(11) NOT NULL,
  `title` varchar(500) NOT NULL,
  `content` text NOT NULL,
  `summary` varchar(1000) DEFAULT NULL,
  `image_url` varchar(500) DEFAULT NULL,
  `category` varchar(100) DEFAULT 'general',
  `source` varchar(200) DEFAULT NULL,
  `author` varchar(200) DEFAULT NULL,
  `published_date` date NOT NULL,
  `is_featured` tinyint(1) DEFAULT 0,
  `is_breaking` tinyint(1) DEFAULT 0,
  `status` enum('draft','published','archived') DEFAULT 'published',
  `view_count` int(11) DEFAULT 0,
  `like_count` int(11) DEFAULT 0,
  `share_count` int(11) DEFAULT 0,
  `tags` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`tags`)),
  `meta_title` varchar(200) DEFAULT NULL,
  `meta_description` varchar(500) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `notifications`
--

CREATE TABLE `notifications` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `message` text NOT NULL,
  `type` enum('news','panchang','horoscope','shopping','general') DEFAULT 'general',
  `target_audience` enum('all','android','ios') DEFAULT 'all',
  `scheduled_at` timestamp NULL DEFAULT NULL,
  `sent_at` timestamp NULL DEFAULT NULL,
  `status` enum('draft','scheduled','sent','failed') DEFAULT 'draft',
  `click_count` int(11) DEFAULT 0,
  `delivery_count` int(11) DEFAULT 0,
  `image_url` varchar(500) DEFAULT NULL,
  `action_url` varchar(500) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `notifications`
--

INSERT INTO `notifications` (`id`, `title`, `message`, `type`, `target_audience`, `scheduled_at`, `sent_at`, `status`, `click_count`, `delivery_count`, `image_url`, `action_url`, `created_at`, `updated_at`) VALUES
(1, 'Breaking News Alert', 'Important news update for all users', 'news', 'all', NULL, NULL, 'sent', 0, 816, NULL, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13'),
(2, 'Daily Panchang', 'Today\'s panchang information is now available', 'panchang', 'all', NULL, NULL, 'sent', 0, 560, NULL, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13'),
(3, 'Horoscope Update', 'Your daily horoscope is ready', 'horoscope', 'all', NULL, NULL, 'sent', 0, 199, NULL, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13'),
(4, 'Shopping Deal', 'Special discount on electronics - 50% off!', 'shopping', 'all', NULL, NULL, 'sent', 0, 478, NULL, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13'),
(5, 'App Update', 'New features available in the latest version', 'general', 'all', NULL, NULL, 'draft', 0, 0, NULL, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13');

-- --------------------------------------------------------

--
-- Table structure for table `panchang`
--

CREATE TABLE `panchang` (
  `id` int(11) NOT NULL,
  `date` date NOT NULL,
  `tithi` varchar(100) DEFAULT NULL,
  `nakshatra` varchar(100) DEFAULT NULL,
  `yoga` varchar(100) DEFAULT NULL,
  `karana` varchar(100) DEFAULT NULL,
  `sunrise` time DEFAULT NULL,
  `sunset` time DEFAULT NULL,
  `moonrise` time DEFAULT NULL,
  `moonset` time DEFAULT NULL,
  `rahu_kalam` varchar(100) DEFAULT NULL,
  `yama_gandam` varchar(100) DEFAULT NULL,
  `gulika_kalam` varchar(100) DEFAULT NULL,
  `abhijit_muhurta` varchar(100) DEFAULT NULL,
  `brahma_muhurta` varchar(100) DEFAULT NULL,
  `good_time` varchar(200) DEFAULT NULL,
  `bad_time` varchar(200) DEFAULT NULL,
  `festival` varchar(200) DEFAULT NULL,
  `special_notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `panchang_items`
--

CREATE TABLE `panchang_items` (
  `id` int(11) NOT NULL,
  `date` date NOT NULL,
  `tithi` varchar(100) DEFAULT NULL,
  `nakshatra` varchar(100) DEFAULT NULL,
  `yoga` varchar(100) DEFAULT NULL,
  `karana` varchar(100) DEFAULT NULL,
  `sunrise` time DEFAULT NULL,
  `sunset` time DEFAULT NULL,
  `moonrise` time DEFAULT NULL,
  `moonset` time DEFAULT NULL,
  `rahu_kalam` varchar(50) DEFAULT NULL,
  `yama_gandam` varchar(50) DEFAULT NULL,
  `gulika_kalam` varchar(50) DEFAULT NULL,
  `abhijit_muhurta` varchar(50) DEFAULT NULL,
  `amrit_kalam` varchar(50) DEFAULT NULL,
  `varjyam` varchar(50) DEFAULT NULL,
  `durmuhurtam` varchar(100) DEFAULT NULL,
  `good_time` varchar(100) DEFAULT NULL,
  `festivals` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`festivals`)),
  `special_notes` text DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- --------------------------------------------------------

--
-- Table structure for table `rss_activity_logs`
--

CREATE TABLE `rss_activity_logs` (
  `id` int(11) NOT NULL,
  `activity_type` varchar(50) NOT NULL,
  `description` text NOT NULL,
  `feed_id` int(11) DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rss_activity_logs`
--

INSERT INTO `rss_activity_logs` (`id`, `activity_type`, `description`, `feed_id`, `category_id`, `created_at`) VALUES
(1, 'test_fetch', 'Test fetch successful for feed \'BBC News - World\'', 1, NULL, '2025-08-27 05:03:35');

-- --------------------------------------------------------

--
-- Table structure for table `rss_categories`
--

CREATE TABLE `rss_categories` (
  `id` int(11) NOT NULL,
  `name` varchar(100) NOT NULL,
  `description` text DEFAULT NULL,
  `color` varchar(7) DEFAULT '#007bff',
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rss_categories`
--

INSERT INTO `rss_categories` (`id`, `name`, `description`, `color`, `created_at`) VALUES
(1, 'తెలుగు వార్తలు', 'Telugu news and current affairs', '#FF5722', '2025-08-26 18:23:28'),
(2, 'రాజకీయాలు', 'Political news and updates', '#2196F3', '2025-08-26 18:23:28'),
(3, 'క్రీడలు', 'Sports news and updates', '#4CAF50', '2025-08-26 18:23:28'),
(4, 'వినోదం', 'Entertainment and cinema news', '#E91E63', '2025-08-26 18:23:28'),
(5, 'వ్యాపారం', 'Business and economy news', '#FF9800', '2025-08-26 18:23:28'),
(6, 'సాంకేతికత', 'Technology and innovation news', '#9C27B0', '2025-08-26 18:23:28'),
(7, 'ఆరోగ్యం', 'Health and wellness news', '#00BCD4', '2025-08-26 18:23:28'),
(8, 'విద్య', 'Education and academic news', '#795548', '2025-08-26 18:23:28'),
(9, 'సాధారణ', 'General news and miscellaneous', '#607D8B', '2025-08-26 18:23:28'),
(10, 'Telugu News', 'Telugu language news and updates', '#007bff', '2025-08-27 05:41:44'),
(11, 'Breaking News', 'Latest breaking news', '#dc3545', '2025-08-27 05:41:44'),
(12, 'Sports', 'Sports news and updates', '#28a745', '2025-08-27 05:41:44'),
(13, 'Entertainment', 'Entertainment and cinema news', '#ffc107', '2025-08-27 05:41:44'),
(14, 'Technology', 'Technology and gadget news', '#17a2b8', '2025-08-27 05:41:44');

-- --------------------------------------------------------

--
-- Table structure for table `rss_feeds`
--

CREATE TABLE `rss_feeds` (
  `id` int(11) NOT NULL,
  `name` varchar(200) NOT NULL,
  `url` varchar(1000) NOT NULL,
  `description` text DEFAULT NULL,
  `category_id` int(11) DEFAULT NULL,
  `refresh_interval` int(11) DEFAULT 3600,
  `is_telugu_content` tinyint(1) DEFAULT 0,
  `status` enum('active','inactive','error') DEFAULT 'active',
  `last_fetch_at` timestamp NULL DEFAULT NULL,
  `last_error` text DEFAULT NULL,
  `error_count` int(11) DEFAULT 0,
  `total_items_fetched` int(11) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rss_feeds`
--

INSERT INTO `rss_feeds` (`id`, `name`, `url`, `description`, `category_id`, `refresh_interval`, `is_telugu_content`, `status`, `last_fetch_at`, `last_error`, `error_count`, `total_items_fetched`, `created_at`, `updated_at`) VALUES
(1, 'BBC News - World', 'http://feeds.bbci.co.uk/news/world/rss.xml', 'BBC World News RSS Feed', 7, 3600, 0, 'active', '2025-08-27 05:03:35', NULL, 0, 1, '2025-08-27 05:03:35', '2025-08-27 05:03:35'),
(2, 'CNN Top Stories', 'http://rss.cnn.com/rss/edition.rss', 'CNN Top Stories RSS Feed', 7, 3600, 0, 'active', NULL, NULL, 0, 0, '2025-08-27 05:03:35', '2025-08-27 05:03:35');

-- --------------------------------------------------------

--
-- Table structure for table `rss_feed_items`
--

CREATE TABLE `rss_feed_items` (
  `id` int(11) NOT NULL,
  `feed_id` int(11) NOT NULL,
  `title` varchar(500) NOT NULL,
  `description` text DEFAULT NULL,
  `link` varchar(1000) NOT NULL,
  `published_date` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
  `guid` varchar(500) DEFAULT NULL,
  `image_url` varchar(1000) DEFAULT NULL,
  `local_image_path` varchar(500) DEFAULT NULL,
  `category` varchar(100) DEFAULT NULL,
  `is_telugu` tinyint(1) DEFAULT 0,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `rss_feed_items`
--

INSERT INTO `rss_feed_items` (`id`, `feed_id`, `title`, `description`, `link`, `published_date`, `guid`, `image_url`, `local_image_path`, `category`, `is_telugu`, `created_at`) VALUES
(1, 1, 'Ukraine admits Russia has entered key region of Dnipropetrovsk', 'Military says Russian advance \"is the first attack of such a large scale\" in industrial province.', 'https://www.bbc.com/news/articles/c17n1p24yv9o?at_medium=RSS&at_campaign=rss', '2025-08-27 05:50:14', 'https://www.bbc.com/news/articles/c17n1p24yv9o#0', NULL, NULL, NULL, 0, '2025-08-27 05:03:35');

-- --------------------------------------------------------

--
-- Table structure for table `shopping_items`
--

CREATE TABLE `shopping_items` (
  `id` int(11) NOT NULL,
  `title` varchar(255) NOT NULL,
  `description` text DEFAULT NULL,
  `price` decimal(10,2) NOT NULL DEFAULT 0.00,
  `original_price` decimal(10,2) DEFAULT NULL,
  `discount_percentage` int(11) DEFAULT 0,
  `category` varchar(100) DEFAULT NULL,
  `brand` varchar(100) DEFAULT NULL,
  `image_url` varchar(500) DEFAULT NULL,
  `product_url` varchar(500) NOT NULL DEFAULT '',
  `rating` decimal(3,2) DEFAULT 0.00,
  `review_count` int(11) DEFAULT 0,
  `availability` enum('in_stock','out_of_stock','limited') DEFAULT 'in_stock',
  `status` enum('active','inactive','expired') DEFAULT 'active',
  `featured` tinyint(1) DEFAULT 0,
  `expires_at` timestamp NULL DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
  `updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Dumping data for table `shopping_items`
--

INSERT INTO `shopping_items` (`id`, `title`, `description`, `price`, `original_price`, `discount_percentage`, `category`, `brand`, `image_url`, `product_url`, `rating`, `review_count`, `availability`, `status`, `featured`, `expires_at`, `created_at`, `updated_at`) VALUES
(1, 'Samsung Galaxy Smartphone', 'Latest Android smartphone with 128GB storage', 299.99, 399.99, 25, 'Electronics', 'Samsung', 'https://example.com/phone.jpg', 'https://example.com/buy-phone', 4.50, 150, 'in_stock', 'active', 1, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13'),
(2, 'Cotton T-Shirt', 'Comfortable 100% cotton t-shirt', 19.99, 29.99, 33, 'Fashion', 'StyleBrand', 'https://example.com/tshirt.jpg', 'https://example.com/buy-tshirt', 4.20, 89, 'in_stock', 'active', 1, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13'),
(3, 'Kitchen Blender', 'Multi-speed kitchen blender', 79.99, 99.99, 20, 'Home', 'KitchenAid', 'https://example.com/blender.jpg', 'https://example.com/buy-blender', 4.70, 203, 'in_stock', 'active', 0, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13'),
(4, 'Telugu Novel', 'Popular Telugu fiction book', 12.99, 15.99, 19, 'Books', 'Publisher', 'https://example.com/book.jpg', 'https://example.com/buy-book', 4.30, 67, 'in_stock', 'active', 0, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13'),
(5, 'Fitness Bands', 'Resistance bands set for home workout', 24.99, 34.99, 29, 'Sports', 'FitBrand', 'https://example.com/bands.jpg', 'https://example.com/buy-bands', 4.40, 112, 'in_stock', 'active', 0, NULL, '2025-08-27 04:29:13', '2025-08-27 04:29:13');

-- --------------------------------------------------------

--
-- Table structure for table `user_analytics`
--

CREATE TABLE `user_analytics` (
  `id` int(11) NOT NULL,
  `device_id` varchar(100) DEFAULT NULL,
  `action` varchar(100) NOT NULL,
  `screen` varchar(100) DEFAULT NULL,
  `item_id` int(11) DEFAULT NULL,
  `item_type` varchar(50) DEFAULT NULL,
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
  `user_agent` text DEFAULT NULL,
  `ip_address` varchar(45) DEFAULT NULL,
  `additional_data` longtext CHARACTER SET utf8mb4 COLLATE utf8mb4_bin DEFAULT NULL CHECK (json_valid(`additional_data`))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

--
-- Indexes for table `app_config`
--
ALTER TABLE `app_config`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `config_key` (`config_key`),
  ADD KEY `idx_config_key` (`config_key`),
  ADD KEY `idx_is_public` (`is_public`);

--
-- Indexes for table `app_settings`
--
ALTER TABLE `app_settings`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `setting_key` (`setting_key`);

--
-- Indexes for table `backup_logs`
--
ALTER TABLE `backup_logs`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `daily_stats`
--
ALTER TABLE `daily_stats`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `date` (`date`);

--
-- Indexes for table `horoscope`
--
ALTER TABLE `horoscope`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_date_sign` (`date`,`sign`);

--
-- Indexes for table `horoscope_items`
--
ALTER TABLE `horoscope_items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_date_sign` (`date`,`zodiac_sign`),
  ADD KEY `idx_date` (`date`),
  ADD KEY `idx_zodiac_sign` (`zodiac_sign`);

--
-- Indexes for table `news`
--
ALTER TABLE `news`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `news_items`
--
ALTER TABLE `news_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_published_date` (`published_date`),
  ADD KEY `idx_category` (`category`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_featured` (`is_featured`),
  ADD KEY `idx_breaking` (`is_breaking`);

--
-- Indexes for table `notifications`
--
ALTER TABLE `notifications`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `panchang`
--
ALTER TABLE `panchang`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_date` (`date`);

--
-- Indexes for table `panchang_items`
--
ALTER TABLE `panchang_items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `date` (`date`),
  ADD KEY `idx_date` (`date`);

--
-- Indexes for table `rss_activity_logs`
--
ALTER TABLE `rss_activity_logs`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_activity_type` (`activity_type`),
  ADD KEY `idx_created_at` (`created_at`),
  ADD KEY `idx_feed_id` (`feed_id`),
  ADD KEY `category_id` (`category_id`);

--
-- Indexes for table `rss_categories`
--
ALTER TABLE `rss_categories`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_name` (`name`);

--
-- Indexes for table `rss_feeds`
--
ALTER TABLE `rss_feeds`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_category_id` (`category_id`),
  ADD KEY `idx_last_fetch` (`last_fetch_at`);

--
-- Indexes for table `rss_feed_items`
--
ALTER TABLE `rss_feed_items`
  ADD PRIMARY KEY (`id`),
  ADD UNIQUE KEY `unique_feed_guid` (`feed_id`,`guid`),
  ADD KEY `idx_feed_id` (`feed_id`),
  ADD KEY `idx_published_date` (`published_date`),
  ADD KEY `idx_is_telugu` (`is_telugu`),
  ADD KEY `idx_guid` (`guid`),
  ADD KEY `idx_link` (`link`(255));

--
-- Indexes for table `shopping_items`
--
ALTER TABLE `shopping_items`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_status` (`status`),
  ADD KEY `idx_category` (`category`),
  ADD KEY `idx_featured` (`featured`);

--
-- Indexes for table `user_analytics`
--
ALTER TABLE `user_analytics`
  ADD PRIMARY KEY (`id`),
  ADD KEY `idx_device_id` (`device_id`),
  ADD KEY `idx_action` (`action`),
  ADD KEY `idx_timestamp` (`timestamp`),
  ADD KEY `idx_item` (`item_type`,`item_id`);

--
-- AUTO_INCREMENT for table `app_config`
--
ALTER TABLE `app_config`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `app_settings`
--
ALTER TABLE `app_settings`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;

--
-- AUTO_INCREMENT for table `backup_logs`
--
ALTER TABLE `backup_logs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `daily_stats`
--
ALTER TABLE `daily_stats`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=31;

--
-- AUTO_INCREMENT for table `horoscope`
--
ALTER TABLE `horoscope`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `horoscope_items`
--
ALTER TABLE `horoscope_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;

--
-- AUTO_INCREMENT for table `news`
--
ALTER TABLE `news`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `news_items`
--
ALTER TABLE `news_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `notifications`
--
ALTER TABLE `notifications`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `panchang`
--
ALTER TABLE `panchang`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `panchang_items`
--
ALTER TABLE `panchang_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `rss_activity_logs`
--
ALTER TABLE `rss_activity_logs`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `rss_categories`
--
ALTER TABLE `rss_categories`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `rss_feeds`
--
ALTER TABLE `rss_feeds`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;

--
-- AUTO_INCREMENT for table `rss_feed_items`
--
ALTER TABLE `rss_feed_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `shopping_items`
--
ALTER TABLE `shopping_items`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=6;

--
-- AUTO_INCREMENT for table `user_analytics`
--
ALTER TABLE `user_analytics`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- Constraints for dumped tables
--

--
-- Constraints for table `rss_activity_logs`
--
ALTER TABLE `rss_activity_logs`
  ADD CONSTRAINT `rss_activity_logs_ibfk_1` FOREIGN KEY (`feed_id`) REFERENCES `rss_feeds` (`id`) ON DELETE CASCADE,
  ADD CONSTRAINT `rss_activity_logs_ibfk_2` FOREIGN KEY (`category_id`) REFERENCES `rss_categories` (`id`) ON DELETE CASCADE;

--
-- Constraints for table `rss_feeds`
--
ALTER TABLE `rss_feeds`
  ADD CONSTRAINT `rss_feeds_ibfk_1` FOREIGN KEY (`category_id`) REFERENCES `rss_categories` (`id`) ON DELETE SET NULL;

--
-- Constraints for table `rss_feed_items`
--
ALTER TABLE `rss_feed_items`
  ADD CONSTRAINT `rss_feed_items_ibfk_1` FOREIGN KEY (`feed_id`) REFERENCES `rss_feeds` (`id`) ON DELETE CASCADE;
COMMIT;

