CREATE TABLE `webImportSources` (
	`id` int AUTO_INCREMENT NOT NULL,
	`userId` int NOT NULL,
	`name` varchar(100) NOT NULL,
	`connectorType` varchar(50) NOT NULL,
	`portalUrl` varchar(500) NOT NULL,
	`loginEmail` varchar(320) NOT NULL,
	`loginPassword` text NOT NULL,
	`frequency` enum('manual','daily','weekly','monthly') NOT NULL DEFAULT 'monthly',
	`autoEnabled` int NOT NULL DEFAULT 0,
	`lastSuccessAt` timestamp,
	`lastStatus` text,
	`lastImportCount` int DEFAULT 0,
	`apiToken` varchar(128) NOT NULL,
	`createdAt` timestamp NOT NULL DEFAULT (now()),
	`updatedAt` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
	CONSTRAINT `webImportSources_id` PRIMARY KEY(`id`)
);
