CREATE TABLE IF NOT EXISTS `data_compile` (
`Module` varchar(191) NOT NULL,
`Service` varchar(191) NOT NULL,
`Package` varchar(191) NOT NULL,
`Branch` varchar(191) NOT NULL,
`Architecture` varchar(255) DEFAULT NULL,
`CanCompilePy` varchar(10) DEFAULT NULL,
`CanCompileCy` varchar(10) DEFAULT NULL,
`CanMypy` varchar(10) DEFAULT NULL,
`CanTy` varchar(10) DEFAULT NULL,
`CanBandit` varchar(10) DEFAULT NULL,
`CompileError` text,
`MypyError` text,
`TyError` text,
`BanditError` text,
`OllamaReview` text,
`Duration` float DEFAULT NULL,
`VerifiedAt` datetime DEFAULT NULL,
PRIMARY KEY (`Module`, `Service`, `Package`, `Branch`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
CREATE TABLE `def_module` (
`Module` varchar(255) NOT NULL,
`Service` varchar(255) DEFAULT NULL,
`Package` varchar(255) DEFAULT NULL,
`GitVersion` varchar(255) DEFAULT NULL,
`CompileVersion3` varchar(255) DEFAULT NULL,
`CompileV3Date` datetime DEFAULT NULL,
`CompileCython` varchar(255) DEFAULT NULL,
`CompileCyDate` datetime DEFAULT NULL,
`CompileCyError` text,
PRIMARY KEY (`Module`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
ALTER TABLE data_compile
ADD COLUMN IF NOT EXISTS `CanMypy` varchar(10) DEFAULT NULL
ALTER TABLE data_compile
ADD COLUMN IF NOT EXISTS `CanTy` varchar(10) DEFAULT NULL
¶ migrate_data_compile_add_can_bandit
ALTER TABLE data_compile
ADD COLUMN IF NOT EXISTS `CanBandit` varchar(10) DEFAULT NULL
ALTER TABLE data_compile
ADD COLUMN IF NOT EXISTS `MypyError` text
ALTER TABLE data_compile
ADD COLUMN IF NOT EXISTS `TyError` text
¶ migrate_data_compile_add_bandit_error
ALTER TABLE data_compile
ADD COLUMN IF NOT EXISTS `BanditError` text
ALTER TABLE data_compile
ADD COLUMN IF NOT EXISTS `OllamaReview` text
INSERT INTO data_compile
(Module, Service, Package, Branch, Architecture,
CanCompilePy, CanCompileCy, CanMypy, CanTy, CanBandit,
CompileError, MypyError, TyError, BanditError, OllamaReview,
Duration, VerifiedAt)
VALUES
('{module}', '{service}', '{package}', '{branch}', '{architecture}',
'{can_compile_py}', '{can_compile_cy}', '{can_mypy}', '{can_ty}', '{can_bandit}',
'{compile_error}', '{mypy_error}', '{ty_error}', '{bandit_error}', '{ollama_review}',
{duration}, NOW())
ON DUPLICATE KEY UPDATE
Architecture = VALUES(Architecture),
CanCompilePy = VALUES(CanCompilePy),
CanCompileCy = VALUES(CanCompileCy),
CanMypy = VALUES(CanMypy),
CanTy = VALUES(CanTy),
CanBandit = VALUES(CanBandit),
CompileError = VALUES(CompileError),
MypyError = VALUES(MypyError),
TyError = VALUES(TyError),
BanditError = VALUES(BanditError),
OllamaReview = VALUES(OllamaReview),
Duration = VALUES(Duration),
VerifiedAt = NOW()
DELETE FROM def_module
WHERE Service = '{factory_set}'
AND Package = '{package}'
AND Branch = '{branch}'
INSERT INTO def_module (Module, Service, Package, GitVersion)
VALUES ('{module}', '{factory_set}', '{package}', '{branch}')
UPDATE def_module
SET CompileVersion3 = '{can_compile_py}',
CompileV3Date = now(),
CompileCython = '{can_compile_cy}',
CompileCyDate = IF({can_compile_cy}, now(), CompileCyDate),
CompileCyError = '{compile_error}'
WHERE Service = '{factory_set}'
AND Package = '{package}'
AND GitVersion = '{branch}'
AND Module = '{module}'