diff --git a/internal/storage/clickhouse.go b/internal/storage/clickhouse.go index 7083d1c..6357974 100644 --- a/internal/storage/clickhouse.go +++ b/internal/storage/clickhouse.go @@ -1003,7 +1003,7 @@ func (c *ClickHouseConnector) DeleteBlockData(chainId *big.Int, blockNumbers []* } func (c *ClickHouseConnector) deleteBatch(chainId *big.Int, blockNumbers []*big.Int, table string, blockNumberColumn string) error { - query := fmt.Sprintf("ALTER TABLE %s.%s DELETE WHERE chain_id = ? AND %s IN (?)", c.cfg.Database, table, blockNumberColumn) + query := fmt.Sprintf("DELETE FROM %s.%s WHERE chain_id = ? AND %s IN (?)", c.cfg.Database, table, blockNumberColumn) blockNumbersStr := make([]string, len(blockNumbers)) for i, bn := range blockNumbers {