CREATE TABLE IF NOT EXISTS `tb_version` (`fd_id` INTEGER PRIMARY KEY AUTOINCREMENT, `fd_version` INTEGER);
CREATE TABLE IF NOT EXISTS `tb_videoHistory` (`fd_widgetId` INTEGER NOT NULL DEFAULT '0' ,`fd_keyword` VARCHAR DEFAULT '' ,`fd_widgetCategoryId` VARCHAR DEFAULT '' ,`fd_widgetAppearence` TEXT DEFAULT '' ,`fd_lastModify` TIMESTAMP DEFAULT '''2008-1-1 00:00:01''' , `fd_imageURL` VARCHAR DEFAULT '', `fd_index` VARCHAR NOT NULL  DEFAULT '', `fd_orderIndex` INTEGER DEFAULT 0, `fd_id` INTEGER PRIMARY KEY AUTOINCREMENT, UNIQUE (`fd_index` desc));
CREATE TABLE IF NOT EXISTS `tb_textHistory` (`fd_type` VARCHAR NOT NULL, `fd_key` VARCHAR NOT NULL, `fd_lastModify` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `fd_widgetValue` VARCHAR DEFAULT '', `fd_widgetCategoryName` VARCHAR DEFAULT 'unknown', `fd_jsonValue` VARCHAR DEFAULT '', UNIQUE (`fd_type`,`fd_key`));
CREATE TABLE IF NOT EXISTS `tb_tag` (`fd_tagType` VARCHAR NOT NULL, `fd_tagName` VARCHAR NOT NULL, `fd_createModify` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `fd_parentName` VARCHAR DEFAULT NULL, `fd_jsonValue` VARCHAR DEFAULT '', `fd_index` INTEGER DEFAULT 0, `fd_id` INTEGER PRIMARY KEY AUTOINCREMENT, UNIQUE (`fd_tagType`,`fd_tagName`));
CREATE TABLE IF NOT EXISTS `tb_albumHistory` (`fd_imageURL` VARCHAR NOT NULL, `fd_categoryName` VARCHAR DEFAULT '', `fd_lastModify` TIMESTAMP DEFAULT CURRENT_TIMESTAMP, `fd_jsonValue` VARCHAR DEFAULT ``, `fd_index` INTEGER DEFAULT 0, `fd_id` INTEGER PRIMARY KEY AUTOINCREMENT, UNIQUE (`fd_imageURL`,`fd_categoryName`));
CREATE TABLE IF NOT EXISTS `tb_rs_tagAndItem` (`fd_tagType` VARCHAR NOT NULL DEFAULT 'album', `fd_tagName` VARCHAR NOT NULL DEFAULT 'default', `fd_itemKey` VARCHAR NOT NULL, `fd_jsonValue` VARCHAR DEFAULT '', UNIQUE (`fd_tagType`,`fd_itemKey`));
INSERT OR REPLACE INTO tb_tag(`fd_tagType`,`fd_tagName`) values ('album','default');
