--
-- Host: 127.0.0.1    Database: bank_scrape
-- ------------------------------------------------------


--
-- Table structure for table `bank_transactions`
--

CREATE TABLE `bank_transactions` (
  `id` int NOT NULL AUTO_INCREMENT,
  `transaction_date` varchar(20) DEFAULT NULL,
  `value_date` varchar(20) DEFAULT NULL,
  `cheque_no` varchar(50) DEFAULT NULL,
  `description` text,
  `amount` decimal(15,2) DEFAULT NULL,
  `balance` decimal(15,2) DEFAULT NULL,
  `bank_id` int DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `done` tinyint(1) DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `bank_id` (`bank_id`),
  CONSTRAINT `bank_transactions_ibfk_1` FOREIGN KEY (`bank_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=6260 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `bank_transactions`
--


--
-- Table structure for table `error_logs`
--

CREATE TABLE `error_logs` (
  `id` int NOT NULL AUTO_INCREMENT,
  `bank_id` int DEFAULT NULL,
  `timestamp` datetime DEFAULT CURRENT_TIMESTAMP,
  `error_message` text,
  PRIMARY KEY (`id`),
  KEY `bank_id` (`bank_id`),
  CONSTRAINT `error_logs_ibfk_1` FOREIGN KEY (`bank_id`) REFERENCES `bank_accounts` (`id`) ON DELETE SET NULL
) ENGINE=InnoDB AUTO_INCREMENT=287 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `error_logs`
--


--
-- Table structure for table `scrape_status`
--

CREATE TABLE `scrape_status` (
  `id` int NOT NULL AUTO_INCREMENT,
  `bank_id` int DEFAULT NULL,
  `last_scrape_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  UNIQUE KEY `bank_id` (`bank_id`),
  CONSTRAINT `scrape_status_ibfk_1` FOREIGN KEY (`bank_id`) REFERENCES `bank_accounts` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13222 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;

--
-- Dumping data for table `scrape_status`
--

INSERT INTO `scrape_status` VALUES (1,1,'2025-04-04 05:31:47'),(13195,2,'2025-04-04 05:31:47');


