diff --git a/src/DotNetCore.CAP.MySql/IStorage.MySql.cs b/src/DotNetCore.CAP.MySql/IStorage.MySql.cs index 5be40b8..49040d1 100644 --- a/src/DotNetCore.CAP.MySql/IStorage.MySql.cs +++ b/src/DotNetCore.CAP.MySql/IStorage.MySql.cs @@ -70,7 +70,8 @@ CREATE TABLE IF NOT EXISTS `{prefix}.received` ( `Added` datetime NOT NULL, `ExpiresAt` datetime DEFAULT NULL, `StatusName` varchar(50) NOT NULL, - PRIMARY KEY (`Id`) + PRIMARY KEY (`Id`), + INDEX `IX_ExpiresAt`(`ExpiresAt`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; CREATE TABLE IF NOT EXISTS `{prefix}.published` ( @@ -82,7 +83,8 @@ CREATE TABLE IF NOT EXISTS `{prefix}.published` ( `Added` datetime NOT NULL, `ExpiresAt` datetime DEFAULT NULL, `StatusName` varchar(40) NOT NULL, - PRIMARY KEY (`Id`) + PRIMARY KEY (`Id`), + INDEX `IX_ExpiresAt`(`ExpiresAt`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; "; return batchSql;